---
title: Instrument AWS Lambda applications
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Serverless > Serverless Monitoring for AWS Lambda > Instrument AWS
  Lambda applications
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Instrument AWS Lambda applications

## Overview{% #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.

{% image
   source="https://docs.dd-static.net/images/serverless/serverless_tracing_installation_instructions.916e542d516b6e0e19d5f1dcf45dc027.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/serverless/serverless_tracing_installation_instructions.916e542d516b6e0e19d5f1dcf45dc027.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A diagram that shows how Datadog receives telemetry from your instrumented AWS Lambda application. Your Lambda application, instrumented with a Datadog Lambda Library, sends logs, traces, enhanced metrics, and custom metrics to the Datadog Lambda Extension, which then pushes this data to Datadog." /%}

## Quick start{% #quick-start %}

To get started, [sign up for a Datadog account](https://app.datadoghq.com/signup/) if you don't already have one. Then, follow the [in-app installation flow in Fleet Automation](https://app.datadoghq.com/fleet/install-agent/latest?platform=lambda) 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](https://github.com/DataDog/serverless-sample-app) 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{% #instrumentation-instructions %}

- [python](https://docs.datadoghq.com/serverless/installation/python.md)
- [nodejs](https://docs.datadoghq.com/serverless/installation/nodejs.md)
- [ruby](https://docs.datadoghq.com/serverless/installation/ruby.md)
- [java](https://docs.datadoghq.com/serverless/installation/java.md)
- [go](https://docs.datadoghq.com/serverless/installation/go.md)
- [dotnet](https://docs.datadoghq.com/serverless/installation/dotnet.md)

## Advanced configurations{% #advanced-configurations %}

After you're done with instrumentation and you've set up telemetry collection, you can use [Configure Serverless Monitoring for AWS Lambda](https://docs.datadoghq.com/serverless/aws_lambda/configuration.md) 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{% #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.

{% tab title="AI Setup CLI" %}
Run the CLI in your project directory (requires Node.js 22+). It links your Datadog account, then instruments your Lambda function:

```shell
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.
{% /tab %}

{% tab title="MCP server" %}
Use the Datadog MCP server's [`serverless_onboarding`](https://docs.datadoghq.com/agentic_onboarding/setup.md?tab=serverlessmonitoring#mcp-server) 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.
```

{% /tab %}

## Further Reading{% #further-reading %}

- [Configure Serverless Monitoring](https://docs.datadoghq.com/serverless/configuration.md)
- [AWS Lambda Integration](https://docs.datadoghq.com/integrations/amazon_lambda.md)
- [Configure AWS Lambda for Serverless Monitoring with Datadog](https://learn.datadoghq.com/courses/visibility-aws-lambda)
- [Datadog MCP Server: serverless_onboarding tool](https://docs.datadoghq.com/mcp_server/tools.md#serverless_onboarding)
