> For the complete documentation index, see [llms.txt](https://docs.thousandeyes.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms/datadog.md).

# Datadog

Datadog is a cloud-based observability platform that unifies metrics, traces, logs, and real user monitoring data to provide end-to-end visibility across applications, networks, and infrastructure. This guide explains how to integrate ThousandEyes metrics with Datadog using OpenTelemetry.

For more information about sending metrics to Datadog using OpenTelemetry, see [Datadog OTLP Metrics Intake Endpoint](https://docs.datadoghq.com/opentelemetry/setup/otlp_ingest/metrics).

## Prerequisites

* You have [created a ThousandEyes test](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms#create-a-test).
* You have generated a Datadog API key:
  1. In the Datadog platform, go to **Organization Settings > API Keys**.
  2. Click **+ New Key**.
  3. Enter a **Name** and click **Create Key**.
  4. Copy and store your API key securely.
* You have identified your Datadog OTLP endpoints. The endpoint depends on your Datadog site (`<DATADOG_SITE>`). To determine your site, see the [Datadog documentation](https://docs.datadoghq.com/getting_started/site/#access-the-datadog-site).

  Use the following endpoints:

  * For metrics: `https://otlp.<DATADOG_SITE>/v1/metrics`
    * Example: `https://otlp.datadoghq.eu/v1/metrics`
  * For logs: `https://otlp.<DATADOG_SITE>/v1/logs`
    * Example: `https://otlp.datadoghq.eu/v1/logs`

## Stream OpenTelemetry Metrics to Datadog

### Step 1: Create a Metrics Integration

#### Using the ThousandEyes UI

1. In ThousandEyes go to **Manage > Integration 1.0**.
2. Click **+New Integration** and select **OpenTelemetry Integration**.
3. Enter a **Name** for the integration.
4. Set the **Target** to **HTTP**.
5. Enter the **Endpoint URL** to send data in OTLP (OpenTelemetry Protocol) format:

   See [Datadog OTLP Metrics Intake Endpoint](https://docs.datadoghq.com/opentelemetry/setup/otlp_ingest/metrics) for the URL that corresponds to your region.
6. For **Preset Configurations**, select **Datadog**.
7. For **Auth Type**, select **Custom**.
8. Add the following **Custom Headers**:
   * `dd-api-key`: `{DD_API_KEY}`
   * `dd-otel-metric-config`: `{"resource_attributes_as_tags": true}`
9. For the OpenTelemetry **Signal**, select **Metric**.
10. For the **Data Model Version**, select **v2**.
11. Select a **test**.

    For more information on creating a test, see [General Setup Instructions](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms#general-setup-instructions).
12. Click **Save**.

#### Using the ThousandEyes API

Create the HTTP stream programmatically:

```curl
 curl -v -XPOST https://api.thousandeyes.com/v7/streams -H "Content-Type: application/json" -H "Authorization: Bearer $BEARER_TOKEN" -d '{
  "type": "opentelemetry",
  "testMatch": [{
    "id": "281474976717575",
    "domain": "cea"
  }],
    }],
    "endpointType": "http",
    "streamEndpointUrl": "https://otlp.datadoghq.com/v1/metrics",
    "customHeaders": {
      "dd-api-key": "<DATADOG_API_KEY>",
      "dd-otel-metric-config": "{'resource_attributes_as_tags': true}"
    }
}'
```

Replace `281474976717575`, `cea`, and `<DATADOG_API_KEY>` with your actual test ID, domain (if needed), and your Datadog API key.

### ThousandEyes Dashboard in Datadog

1. Download the dashboard template: [Download ThousandEyes Dashboard Datadog dashboard template](https://github.com/thousandeyes/thousandeyes-observability-dashboards/blob/main/datadog/ThousandEyesDashboard.json)
2. In Datadog, go to **Dashboards** and click **New Dashboard > Import Dashboard JSON**.
3. Upload the downloaded JSON file.
4. Open the dashboard to visualize ThousandEyes metrics in Datadog.

![ThousandEyes Dashboard in Datadog](/files/wTfeWFPzDk5nS3O18n74)

## Stream OpenTelemetry Logs to Datadog

### Step 1: Create a Logs Integration

#### Using the ThousandEyes UI

1. In ThousandEyes go to **Manage > Integration 1.0**.
2. Click **+New Integration** and select **OpenTelemetry Integration**.
3. Enter a **Name** for the integration.
4. Set the **Target** to **HTTP**.
5. Enter the **Endpoint URL** to send data in OTLP (OpenTelemetry Protocol) format:

   See [Datadog OTLP Logs Intake Endpoint](https://docs.datadoghq.com/opentelemetry/setup/otlp_ingest/logs) for the URL that corresponds to your region.
6. For **Preset Configurations**, select **Datadog**.
7. For **Auth Type**, select **Custom**.
8. Add the following **Custom Headers**:
   * `dd-api-key`: `{DD_API_KEY}`
9. For the OpenTelemetry **Signal**, select **Log**.
10. Select a **test**.

    For more information on creating a test, see [General Setup Instructions](https://docs.thousandeyes.com/product-documentation/integration-guides/opentelemetry/observability-platforms#general-setup-instructions).
11. Click **Save**.

#### Using the ThousandEyes API

Create the HTTP stream programmatically:

```curl
curl -v -XPOST https://api.thousandeyes.com/v7/streams \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $BEARER_TOKEN" \
  -d '{
    "type": "opentelemetry",
    "endpointType": "http",
    "signal": "log",
    "streamEndpointUrl": "https://otlp.datadoghq.com/v1/logs",
    "customHeaders": {
      "dd-api-key": "<DATADOG_API_KEY>"
    }
  }'
```

Replace `<DATADOG_API_KEY>` with your Datadog API key.

### Step 2: Visualize Logs in Datadog

1. In Datadog, navigate to **Logs > Explorer**.
2. Search for ThousandEyes logs and apply filters.

   For example, you can use the following query to find logs that contain ThousandEyes data: `@resource.attributes.thousandeyes.account.id: *`

![ThousandEyes Logs in Datadog](/files/A2zGuftkw1ljw2MSeBFP)
