• Home
  • Deploy Dynatrace
  • Set up Dynatrace on cloud platforms
  • Amazon Web Services
  • Integrations
  • Monitor AWS Lambda
  • Trace .NET Lambda functions
  • Configuration for monitoring AWS Lambda with OpenTelemetry

Configuration for monitoring AWS Lambda with OpenTelemetry

Dynatrace provides enhancements to OpenTelemetry for AWS Lambda such as exporters, additional instrumentation, and helper libraries to simplify the monitoring of AWS Lambda.

For a list of language-specific packages that you can use in combination with the native OpenTelemetry SDKs and APIs or AWS Distribution for OpenTelemetry, see Trace .NET Lambda functions.

Prerequisites

  • Dynatrace version 1.240+
  • OneAgent version 1.193+ for all OneAgents participating in a trace
  • In the Dynatrace menu, go to Settings > Preferences > OneAgent features and activate the Forward Tag 4 trace context extension OneAgent feature.

Installation

Select a monitoring solution and configuration method

Specify a Dynatrace API endpoint

Apply the configuration to your AWS Lambda function

Instrument the function code

Select a monitoring solution and configuration method

Note: Configuration options regarding Lambda layers don't apply here.

  1. In the Dynatrace menu, go to Deploy Dynatrace and select Start installation.
  2. On the Install OneAgent page, select AWS Lambda.
  3. On Enable Monitoring for AWS Lambda Functions, under Select monitoring solution, select AWS Lambda OpenTelemetry package from the dropdown menu.
  4. Under Select a configuration method, select your preferred configuration method from the dropdown menu. Make sure you set all properties for the selected method.

Specify a Dynatrace API endpoint optional

If you don't want to use the default public Dynatrace endpoint, specify a custom Dynatrace API endpoint where you want to receive monitoring data.

Note: To reduce network latency, you typically deploy a Dynatrace ActiveGate close to (in the same region as) the AWS Lambda function that you want to monitor.

Apply the configuration to your AWS Lambda function

To apply the configuration, select one of the options below, depending on your configuration method.

Configure with JSON file

Copy the JSON snippet into a file named dtconfig.json located in the root folder of your AWS Lambda Functions deployment.

Configure with environment variables

On Enable Monitoring for AWS Lambda Functions, under Use the following values to define environment variables for your AWS Lambda function, there's a snippet with all required environment variables. Be sure to add these environment variables and their values to your Lambda function configuration. For details, see Configuring environment variables.

Instrument the function code

Adding the required API calls to monitor function invocations via OpenTelemetry is specific to languages and their respective OpenTelemetry distribution.

To get detailed instructions for different languages supported by Dynatrace, see Trace .NET Lambda functions.

Known limitations

The Dynatrace instrumentation doesn't capture the IP addresses of outgoing HTTP requests. If the called service isn't monitored with Dynatrace, this results in unmonitored hosts.