The Datadog AWS Lambda Library
Actively maintained. Last release 6 weeks ago, commits in 18 of the last 26 weeks. A safe choice.
pip install datadog-lambdadatadog-lambda-python
Datadog Lambda Library for Python (3.8, 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14) enables enhanced Lambda metrics, distributed tracing, and custom metric submission from AWS Lambda functions.
Installation
Follow the installation instructions, and view your function's enhanced metrics, traces and logs in Datadog.
Configuration
Follow the configuration instructions to tag your telemetry, capture request/response payloads, filter or scrub sensitive information from logs or traces, and more.
For additional tracing configuration options, check out the official documentation for Datadog trace client.
Besides the environment variables supported by dd-trace-py, the datadog-lambda-python library added following environment variables.
| Environment Variables | Description | Default Value |
|---|---|---|
| DD_ENCODE_AUTHORIZER_CONTEXT | When set to true for Lambda authorizers, the tracing context will be encoded into the response for propagation. Supported for NodeJS and Python. | true |
| DD_DECODE_AUTHORIZER_CONTEXT | When set to true for Lambdas that are authorized via Lambda authorizers, it will parse and use the encoded tracing context (if found). Supported for NodeJS and Python. |