AWS 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 OpenTelemetry includes the Datadog exporter, which takes OpenTelemetry data (metrics, traces and logs) collected by the ADOT 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
- Download the ADOT Collector.
- Deploy the ADOT Collector.
- 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 ADOT collector to send metrics, traces and logs 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.name
, service.name
, and service.version
using the language's SDK. As a fall-back, you can also configure hostname (optionally) 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:
- Manually set the hostname in configuration
- Cloud integration API hostname
- Kubernetes hostname
- Fully qualified domain name
- Operating system hostname
Configuring the pipeline
Finally, add a datadog
exporter pipeline to your otel-collector-configuration.yml
file. This shows a traces
pipeline. Also, refer to Setting up the OpenTelemetry Collector with the Datadog Exporter .
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: 10s7
8exporters:9 datadog/api:10 hostname: i-0e123a456a123456a11
12 host_metadata:13 tags:14 - geo.country:fr15
16 api:17 key: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"18 site: datadoghq.eu19
20service:21 pipelines:22 traces:23 receivers: [otlp]24 processors: [batch]25 exporters: [datadog/api]
Here is an example configuration for collecting metrics data:
1receivers:2 otlp:3
4processors:5 batch:6 timeout: 10s7
8exporters:9 datadog/api:10 hostname: i-0e123a456a123456a11
12 host_metadata:13 tags:14 - geo.country:fr15
16 api:17 key: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"18 site: datadoghq.eu19
20service:21 pipelines:22 metrics:23 receivers: [otlp]24 processors: [batch]25 exporters: [datadog/api]
Here is an example configuration for collecting logs data:
1receivers:2 otlp:3
4processors:5 batch:6 timeout: 10s7
8exporters:9 datadog/api:10 hostname: i-0e123a456a123456a11
12 host_metadata:13 tags:14 - geo.country:fr15
16 api:17 key: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"18 site: datadoghq.eu19
20service:21 pipelines:22 logs:23 receivers: [otlp]24 processors: [batch]25 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 ADOT 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.