The AWS managed Lambda layer for ADOT Python provides a plug and play user experience by automatically instrumenting a Lambda function, by packaging OpenTelemetry Python together with an out-of-the-box configuration for AWS Lambda and AWS X-Ray. Users can enable and disable OpenTelemetry for their Lambda function without changing code.
RequirementsThe Lambda layer supports Python [3.8, 3.9, 3.10, 3.11, 3.12 and 3.13] Lambda runtimes. For more information about supported Python versions, see the OpenTelemetry Python documentation and the package on PyPi.
Add the ARN of the Lambda LayerIn this section, we consume the Lambda layer for use with Python Lambda Functions. This includes a reduced version of the AWS Distro for OpenTelemetry Collector (ADOT Collector), which runs as a Lambda extension.
Note: Lambda layers are a regionalized resource, meaning that they can only be used in the Region in which they are published. Make sure to use the layer in the same region as your Lambda functions.
Find the supported regions and amd64/arm64 layer ARN in the table below for the ARNs to consume. Use amd64
as architecture for x86-based processors.
Contains ADOT Collector v0.43.0
Enable auto-instrumentation for your Lambda functionTo enable the AWS Distro for OpenTelemetry in your Lambda function, you need to add and configure the layer, and then enable tracing.
AWS_LAMBDA_EXEC_WRAPPER
and set it to /opt/otel-instrument
.Tips:
To disable OpenTelemetry for your Lambda function, remove the Lambda layer, remove the environment variable AWS_LAMBDA_EXEC_WRAPPER
, and disable active tracing, as explained in the section above.
The ADOT Python layer combines both OpenTelemetry Python and the ADOT Collector. The configuration of the ADOT Collector follows the OpenTelemetry standard.
By default, the ADOT Lambda layer uses the config.yaml, which exports telemetry data to AWS X-Ray. To customize the Collector config, see the main Lambda section for custom configuration instructions
The ADOT Python Lambda Layer can also be configured to set a Meter Provider with an appropriate reader and exporter if the OTEL_METRICS_EXPORTER
environment variable is set to the values noted here.
The OTEL_EXPORTER_OTLP_PROTOCOL
environment variable should also be set in correlation to the metrics exporter with these supported values. If these environment variables are not set, then a default Meter Provider with no readers will be set and cannot be overriden.
For additional instrumentation, see the OpenTelemetry Python documentation.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4