This page explains how to auto-instrument AWS Lambda functions and send telemetry data to Axiom using AWS Distro for OpenTelemetry.
Create a new Lambda function
Add the ADOT Lambda layer
AWS_REGION
with the AWS Region to send the request to. For example, us-west-1
.ARCH
with the system architecture type. For example, arm64
.VERSION
with the latest version number specified in the AWS documentation. For example, ver-1-25-0:1
.Create the collector configuration file
/var/task/collector.yaml
with the following content. This tells the collector to receive telemetry data from the OTLP receiver and export it to Axiom.AXIOM_DOMAIN
with api.axiom.co
if your organization uses the US region, and with api.eu.axiom.co
if your organization uses the EU region. For more information, see Regions.Replace API_TOKEN
with the Axiom API token you have generated. For added security, store the API token in an environment variable.Replace DATASET_NAME
with the name of the Axiom dataset where you want to send data.Set environment variables
AWS_LAMBDA_EXEC_WRAPPER
wraps the function handler with the OpenTelemetry Lambda wrapper. This layer enables the auto-instrumentation for your Lambda function by initializing the OpenTelemetry agent and handling the lifecycle of spans.OPENTELEMETRY_COLLECTOR_CONFIG_FILE
specified the location of the collector configuration file.Run your function and observe telemetry data in Axiom