How-To: Set up Datadog for distributed tracing

Set up Datadog for distributed tracing

Dapr captures metrics and traces that can be sent directly to Datadog through the OpenTelemetry Collector Datadog exporter.

Configure Dapr tracing with the OpenTelemetry Collector and Datadog

Using the OpenTelemetry Collector Datadog exporter, you can configure Dapr to create traces for each application in your Kubernetes cluster and collect them in Datadog.

Before you begin, set up the OpenTelemetry Collector.

  1. Add your Datadog API key to the ./deploy/opentelemetry-collector-generic-datadog.yaml file in the datadog exporter configuration section:

    1. data:
    2. otel-collector-config:
    3. ...
    4. exporters:
    5. ...
    6. datadog:
    7. api:
    8. key: <YOUR_API_KEY>
  2. Apply the opentelemetry-collector configuration by running the following command.

    1. kubectl apply -f ./deploy/open-telemetry-collector-generic-datadog.yaml
  3. Set up a Dapr configuration file that will turn on tracing and deploy a tracing exporter component that uses the OpenTelemetry Collector.

    1. kubectl apply -f ./deploy/collector-config.yaml
  4. Apply the appconfig configuration by adding a dapr.io/config annotation to the container that you want to participate in the distributed tracing.

    1. annotations:
    2. dapr.io/config: "appconfig"
  5. Create and configure the application. Once running, telemetry data is sent to Datadog and visible in Datadog APM.

Datadog APM showing telemetry data.

Last modified October 11, 2024: Fixed typo (#4389) (fe17926)