Instrument AWS Lambda applications
Overview
Instrument your AWS Lambda applications with a Datadog Lambda Extension to collect traces, enhanced metrics, and custom metrics. The Datadog Lambda Extension is analogous to using the Datadog Agent and Datadog SDKs for host-based infrastructure and applications.
Quick start
To get started, sign up for a Datadog account if you don’t already have one. Then, follow the in-app installation flow in Fleet Automation for AWS Lambda to instrument your Lambda functions. This quick-start configuration enables your functions to send real-time metrics, logs, and traces to Datadog.
A sample application is available on GitHub with instructions on how to deploy with multiple runtimes and infrastructure-as-code tools.
The quick start process configures your Lambda functions on the fly. To instrument Lambda functions permanently, see the detailed instructions in the next section.
Instrumentation instructions
Advanced configurations
After you’re done with instrumentation and you’ve set up telemetry collection, you can use Configure Serverless Monitoring for AWS Lambda to:
- connect your metrics, traces, and logs using tags
- collect telemetry from AWS resources such as API Gateway, AppSync, and Step Functions
- capture the request and response payloads for individual Lambda invocations
- link errors of your Lambda functions to your source code
- filter or scrub sensitive information from logs or traces
Set up with agentic onboarding
Use agentic onboarding to set up monitoring for your Lambda functions with AI assistance. Agentic onboarding detects your project’s frameworks, applies the required configuration in place, and verifies that data is flowing. Two complementary paths use the same Datadog account:
- AI Setup CLI: A standalone terminal tool. Use it when you don’t want to install an MCP server.
- MCP server: Set up from your IDE through a coding assistant such as Claude Code or Cursor.
Run the CLI in your project directory (requires Node.js 22+). It links your Datadog account, then instruments your Lambda function:
npx @datadog/ai-setup-cli --product serverless --serverless-compute-type=aws-lambda
Omit --product to run interactively, or add --site to target your Datadog site.
Use the Datadog MCP server’s serverless_onboarding tool to set up monitoring for your Lambda functions with AI assistance. After you connect, try a prompt like:
Help me monitor my AWS Lambda functions with Datadog.
Further Reading
Additional helpful documentation, links, and articles: