Documentation forSolarWinds Observability SaaS

AWS Lambda instrumentation for Python

Compatibility

The supported runtime versions are Python 3.8, 3.9, 3.10, and 3.11.

Most of the Python Library features are supported in the AWS Lambda environment. The exceptions are:

Add layer

Ensure the otelcol layer is already added and configured.

The layer ARN is listed in the SolarWinds Observability Summary Release Notes. Be sure to choose the AWS Region and architecture that correspond to your Lambda function.

An example of adding the arm64 Python instrumentation layer to your function (in the us-east-1 region) using AWS CLI v2:

The --layers argument replaces what is set for the function, so any existing layers should be specified in the argument.

aws lambda update-function-configuration --function-name <your-function-name> --layers 'arn:aws:lambda:us-east-1:851060098468:layer:solarwinds-apm-python-arm64-1_6_0:1' ...

Configure

Set the required environment variables listed below in your Lambda function’s configuration settings. Recommended and useful optional settings are also listed.

Environment variable Description Requirement
AWS_LAMBDA_EXEC_WRAPPER

/opt/solarwinds-apm/wrapper

This must be set to enable the instrumentation extension.

Required
SW_APM_TRANSACTION_NAME

<transaction-name>

Telemetry from the Lambda function will be associated with this Transaction under the SolarWinds Observability SaaS Service. If unset, the Transaction name defaults to the Lambda function name.

Recommended
SW_APM_DEBUG_LEVEL

Configure the Python Library

This may be useful for diagnostic purposes or for reducing logging to AWS CloudWatch.

Optional

The other standard Python Library configuration options that are supported in the AWS Lambda environment are listed below.