AWS Open Distro for OpenTelemetry

Datadog Exporter

Datadog Exporter

Overview

Datadog provides monitoring and insights into infrastructure and application performance across your entire stack. The AWS Distro for Open Telemetry includes the Datadog exporter, which takes OpenTelemetry data (metrics and traces) collected by the AWS OTel Collector and forwards it on to Datadog. From there, you can use Datadog tools and dashboards to analyze and solve performance problems in your distributed apps.

Prerequisites

  1. Download the AWS OTel Collector.
  2. Deploy the AWS OTel Collector.
  3. Get a copy of your Datadog API key. If you don't already have a Datadog account, sign up for a Datadog Free Trial.

Configuring the exporter

Configure the AWS OTel collector to send metrics and traces to Datadog by adding a datadog exporter to your OpenTelemetry configuration YAML file along with your Datadog API key:

1datadog:
2 api:
3 key: "<API key>"

To send the data to the Datadog EU site, also set the site parameter:

1datadog:
2 api:
3 key: "<API key>"
4 site: datadoghq.eu

For trace data: Include a batch processor configured with a required timeout setting of 10s (10 seconds). This sends batches of trace data to Datadog every 10 seconds, ensuring efficient and accurate trace metrics processing.

1processors:
2 batch:
3 timeout: 10s

Specifying resource attributes

On each OpenTelemetry-instrumented application, set the resource attributes development.environment, service.name, and service.version using the language's SDK. As a fall-back, you can also configure hostname (optionally), environment, service name, and service version at the collector level for unified service tagging by following the example configuration file. If you don't specify the hostname explicitly, the exporter attempts to get an automatic default by checking the following sources in order, falling back to the next one if the current one is unavailable or invalid:

  1. Manually set the hostname in configuration
  2. EC2 non-default hostname (if in an EC2 instance)
  3. EC2 instance id (if in an EC2 instance)
  4. Fully qualified domain name
  5. Operating system hostname

Configuring the pipeline

Finally, add a datadog exporter pipeline to your otel-collector-configuration.yml file. This shows a traces pipeline:

1service:
2 pipelines:
3 traces:
4 receivers: [otlp]
5 processors: [batch]
6 exporters: [datadog/api]

Example configurations

Here is an example configuration for collecting trace data using the otlp receiver, a batch processor, the datadog exporter with resource attributes and tags, and a trace pipeline configured with an otlp receiver, batch processor, and datadog exporter:

1receivers:
2 otlp:
3
4processors:
5 batch:
6 timeout: 10s
7
8exporters:
9 datadog/api:
10 hostname: i-0e123a456a123456a
11 env: prod
12 service: web-store
13 version: 7.1.0
14
15 tags:
16 - geo.country:fr
17
18 api:
19 key: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
20 site: datadoghq.eu
21
22service:
23 pipelines:
24 traces:
25 receivers: [otlp]
26 processors: [batch]
27 exporters: [datadog/api]

Here is an example configuration for collecting metrics data:

1receivers:
2 otlp:
3
4exporters:
5 datadog/api:
6 hostname: i-0e123a456a123456a
7 env: prod
8
9 tags:
10 - geo.country:fr
11
12 api:
13 key: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
14 site: datadoghq.eu
15
16service:
17 pipelines:
18 metrics:
19 receivers: [otlp]
20 exporters: [datadog/api]

Supply the relative path to this configuration file when you start the collector by passing it in using the --config=<path/to/configuration_file> command line argument. For examples of supplying a configuration file, see the AWS OpenTelemetry Collector documentation for your target platform.

Resources

For additional information about the Datadog exporter and environment specific onboarding instructions, visit the Datadog OpenTelemetry Collector documentation or the open-telemetry Github repository.

Support

Need help with the Datadog exporter? Contact Datadog support.