Supported runtimes: Node.js, Python

You can use remote instrumentation to quickly add instrumentation to your AWS Lambda functions and keep them instrumented securely.

The instrumenter is a Lambda function that ensures your target functions have the Datadog Lambda extension and Datadog Lambda library added. The instrumenter also ensures that your functions remain instrumented and can send telemetry to Datadog.

The instrumenter must be deployed to every region and account where you want to instrument functions.

Prerequisites

Setup

  1. On the Serverless > AWS Lambda page, select Instrument Functions.

  2. On the Select AWS Region and Launch CloudFormation modal:

    • Click Select API Key to select the Datadog API key to use to send data to your AWS account.
    • Use the Select a region drop-down to choose the region where you want to enable instrumentation.
  3. Click Launch CloudFormation Template. You are prompted to deploy the template into your environment. Launching the template can take a few minutes.

    Datadog recommends that you always test remote instrumentation on development functions before moving to staging and production.

    The CloudFormation stack deploys the instrumenter function, datadog-remote-instrumenter, into your account and region. The stack also creates a CloudTrail and some adjacent resources.

  4. After the instrumenter function is deployed, select functions to instrument. You can select functions by tag or by function name. To enable instrumentation for multiple functions at once, you could apply a custom tag (for example, dd_serverless_instrument:true) to all the functions you want to instrument, and use this tag to select all of your desired functions.

    After you finish your selections, click Enable Remote Instrumentation.

    Datadog recommends that you only instrument Lambda functions with a memory size greater than 256 MB.
  5. Confirm your function selections. You can also set the layer version, which is used for all future instrumentation. This version remains fixed until you manually update it. Updates can take a few minutes to be applied.

Verification

To confirm that your functions are instrumented with Datadog, open your AWS Console and ensure that two layers (Datadog Lambda extension and datadog-lambda-python or datadog-lambda-js) have been added to each selected function.

Removing instrumentation

Deleting the CloudFormation stack in a region automatically removes instrumentation from all functions in that region.

Troubleshooting

If you see issues related to IAM roles, ensure that you have permission to create resources for the following services:

  • EventBridge
  • S3
  • CloudTrail
  • Lambda
PREVIEWING: guacbot/translation-pipeline