Skip to content

Latest commit

 

History

History
 
 

nodejs

OpenTelemetry Lambda NodeJS

Layer for running NodeJS applications on AWS Lambda with OpenTelemetry. Adding the layer and pointing to it with the AWS_LAMBDA_EXEC_WRAPPER environment variable will initialize OpenTelemetry, enabling tracing with no code change.

To use, add the layer to your function configuration and then set AWS_LAMBDA_EXEC_WRAPPER to /opt/otel-handler.

AWS SDK v2 instrumentation is also included and loaded automatically if you use the AWS SDK v2.

Building

To build the layer and sample applications in this nodejs folder:

First install dependencies:

npm install

Then build the project:

npm run build

You'll find the generated layer zip file at ./packages/layer/build/layer.zip.

Sample applications

Sample applications are provided to show usage of the above layer.