| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Layers for running Java applications on AWS Lambda with OpenTelemetry.
Two types of layers are provided
The OpenTelemetry Java Agent is bundled into the base of the layer and can be loaded into a Lambda function by specifying the AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-handler in your Lambda configuration. The agent will be automatically loaded and instrument your application for all supported libraries.
Note, automatic instrumentation has a notable impact on startup time on AWS Lambda and you will generally need to use this along with provisioned concurrency and warmup requests to serve production requests without causing timeouts on initial requests while it initializes.
OpenTelemetry Lambda Instrumentation and OpenTelemetry SDK are bundled into the java/lib directory to be available on the classpath of the Lambda function. No code change is needed to instrument the execution of your function, but you will need to set the AWS_LAMBDA_EXEC_WRAPPER environment variable pointing to the appropriate wrapper for the type of handler.
AWS SDK instrumentation is also included and loaded automatically if you use the AWS SDK.
For any other library, such as OkHttp, you will need to include the corresponding library instrumentation from the instrumentation project and modify your code to initialize it in your function.
To build the Java Agent layer, run
./gradlew :layer-javaagent:build
The layer zip file will be present at ./layer-javaagent/build/distributions/opentelemetry-javaagent-layer.zip.
To build the wrapper layer, run
./gradlew :layer-wrapper:build
The layer zip file will be present at ./layer-wrapper/build/distributions/opentelemetry-java-wrapper.zip.
Sample applications are provided to show usage the above layers.
Application using AWS SDK - shows how both the wrapper and agent can be used with an application using AWS SDK without code change.
Application using OkHttp - shows the manual initialization of OkHttp library instrumentation for use with the wrapper. The agent would be usable without such a code change at the expense of the cold start overhead it introduces.
| Back | FazBrowse Home | New Git URL |