Dash0 Logo
Infrastructure MonitoringLog ManagementApplication Performance ManagementDistributed TracingKubernetes MonitoringWebsite MonitoringDashboardsAlertingService MapIntegrationsTransparent CostObservability as Code
PricingDocs
GuidesBlogKnowledgeComparisonsPodcastIntegrationsChangelog
Contact usMeet our TeamCareersSecurity
  • Book A Demo
  • Sign In
  • Start Free Trial
Book a demoSign in
Start Free Trial

Resources

  • Pricing
  • Blog
  • Guides
  • Knowledge
  • Comparisons
  • Integrations
  • Documentation
  • Glossary
  • OTelBin.io
  • Sitemap

Company

  • Our Team
  • Careers
  • Trust Center
  • Security

Compare

  • Datadog
  • Grafana
  • Dynatrace
  • New Relic
  • Elastic
  • Honeycomb
  • Sentry

Contact

  • Contact us
  • GitHub
  • LinkedIn
  • X
  • YouTube
  • Dash0 Newsletter
  • Terms and Conditions
  • Privacy Policy
  • Data Processing Agreement
  • Vulnerability Disclosure

©2025 Dash0 Inc.

Hub/AWS Lambda

Technology

AWS Lambda

Dash0 integrates with AWS Lambda to collect telemetry data such as traces, logs, and metrics.

Overview

Overview

AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers. You can use AWS Lambda to run code in response to events such as changes in data or system state, or actions by users. You can integrate AWS Lambda with Dash0 to send telemetry data such as logs, metrics, and traces.

Use Cases

  • Trace requests handled by your Lambda functions.
  • Monitor the performance of your Lambda functions.
  • Analyze the behavior of your Lambda functions in production.

Related Integrations

AWS

In this section
    TechnologyOverviewUse CasesSetupPrerequisitesConfigurationRelated integrations

Setup

Setup

To collect telemetry data from an AWS Lambda function, you need to instrument your Lambda function with an OpenTelemetry SDK and configure the latter to send telemetry to Dash0.

The traces, logs and metrics generated by the OpenTelemetry SDK inside your function is routed to a local OpenTelemetry Collector, acting as a AWS Lambda External Extension, which then forwards it to Dash0. The local OpenTelemetry Collector also collects as logs the output your function sends to its standard output and standard error.

For collecting the platform metrics from the Lambda runtime, like throttles and recursive invocations, use the CloudWatch metrics integration.

Prerequisites

Before starting, ensure you have:

  • An existing AWS Lambda function
  • Appropriate IAM permissions to modify Lambda functions and layers
  • Knowledge of your Lambda function's runtime and architecture (x86_64 or arm64)

Configuration

The setup is based on the OpenTelemetry Lambda setup and varies depending on your Lambda function's programming language.

Step 1: Create the OpenTelemetry Collector Configuration

You need to create a configuration file that tells the OpenTelemetry Collector how to send telemetry data to Dash0. You can store this configuration in three ways:

  1. Lambda Layer (Recommended) - Easiest to manage and reuse
  2. Function Bundle - Include directly in your deployment package
  3. S3 Bucket - Store remotely and reference via URI

Configuration File Content

Create a file named otel-collector-config.yaml with the following content:

Creating a Configuration Layer (Recommended)

To create a Lambda layer containing your configuration:

  1. Open the Lambda Layers console.
  2. Choose Create layer.
  3. Enter a name for your layer (e.g., otel-collector-config).
  4. Upload a .zip file containing the otel-collector-config.yaml file in the root directory.
  5. Select the architecture for your layer (x86_64 or arm64).
  6. Choose the compatible runtimes for your layer.
  7. Click Create.

For detailed instructions, see the AWS documentation on creating layers.

Step 2: Add Required Layers to Your Lambda Function

Your Lambda function needs three layers:

  1. OpenTelemetry Instrumentation Layer - Language-specific auto-instrumentation
  2. OpenTelemetry Collector Layer - Processes and exports telemetry data
  3. Configuration Layer - Contains your collector configuration (if using the layer approach)

Adding Layers via AWS Console

  1. Go to the AWS Lambda Console.
  2. Select your Lambda function.
  3. In the "Layers" section, click Add a layer.
  4. Select Specify an ARN and paste the appropriate ARN from the table below.
  5. Click Verify to ensure the layer is compatible with your region, language, and architecture.
  6. Click Add to add the layer to your Lambda function.
  7. Repeat this process for all three required layers.

Layer ARNs and Versions

Replace <region> with your AWS region and <version> with the latest version number.

RuntimeInstrumentation Layer ARNLatest VersionWrapper Path
Node.jsarn:aws:lambda:<region>:184161586896:layer:opentelemetry-nodejs-<version>:1NodeJS/opt/otel-handler
Pythonarn:aws:lambda:<region>:184161586896:layer:opentelemetry-python-<version>:1Python/opt/otel-instrument
Java Agentarn:aws:lambda:<region>:184161586896:layer:opentelemetry-javaagent-<version>:1Java Agent/opt/otel-handler
Java Wrapperarn:aws:lambda:<region>:184161586896:layer:opentelemetry-javawrapper-<version>:1Java Wrapper/opt/otel-handler
Rubyarn:aws:lambda:<region>:184161586896:layer:opentelemetry-ruby-dev-<version>:1Ruby/opt/otel-handler

OpenTelemetry Collector Layer:

  • ARN: arn:aws:lambda:<region>:184161586896:layer:opentelemetry-collector-<amd64|arm64>-<version>:1
  • Latest Version: Collector

Step 3: Configure Environment Variables

  1. In your Lambda function's Configuration tab, click Environment variables.
  2. Add the following environment variables:

Required Environment Variables

VariableValueDescription
AWS_LAMBDA_EXEC_WRAPPERSee table abovePath to the OpenTelemetry wrapper for your runtime
OPENTELEMETRY_COLLECTOR_CONFIG_URISee options belowLocation of your collector configuration file

Configuration URI Options

Choose one based on how you stored your configuration file:

  • Lambda Layer: /opt/otel-collector-config.yaml

  • Function Bundle: /var/task/otel-collector-config.yaml

  • S3 Bucket: s3://<bucket_name>.s3.<region>.amazonaws.com/otel-collector-config.yaml

    Note: For S3, ensure your Lambda function has permissions to read the bucket and use the full S3 URI including the s3:// prefix.

  1. Click Save to apply the environment variables.

Step 4: Verify Your Setup

After completing the setup:

  1. Test your Lambda function to ensure it still works correctly
  2. Check CloudWatch Logs for any OpenTelemetry-related errors
  3. Verify telemetry data appears in your Dash0 dashboard

Logs

The OpenTelemetry collector automatically collects Lambda function logs and sends them to Dash0.

Important: To correlate logs with traces, use a logger that supports OpenTelemetry. Your logs should include tracing information as part of their structured output.

Metrics

Application metrics emitted using the OpenTelemetry SDK are automatically captured by the collector and exported to Dash0.

For Lambda runtime metrics (invocation count, duration, error rates, etc.), use the CloudWatch metrics integration.