---
title: Datadog Extension
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > OpenTelemetry in Datadog > Integrations > Datadog Extension
---

# Datadog Extension

## Overview{% #overview %}

As of OpenTelemetry Collector Contrib [modules v0.129.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.129.0) and newer, the Datadog Extension is included in [contrib distributions](https://github.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.129.1) of OpenTelemetry Collector. It is also available for [custom builds](https://opentelemetry.io/docs/collector/custom-collector/) of OpenTelemetry Collector. In the [DDOT Collector](https://docs.datadoghq.com/opentelemetry/setup/ddot_collector.md), the extension is automatically enabled.

The Datadog Extension allows you to view OpenTelemetry Collector configuration and build information directly in Datadog using [Fleet Automation](https://app.datadoghq.com/fleet), the [Infrastructure List](https://app.datadoghq.com/infrastructure), and [Resource Catalog](https://app.datadoghq.com/infrastructure/catalog). When used with the [Datadog Exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/datadogexporter), this extension gives you visibility into your Collector fleet without leaving the Datadog UI.

{% image
   source="https://docs.dd-static.net/images/agent/fleet_automation/fleet-automation-pipeline-view.a669402744743088964b9801c2155281.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/agent/fleet_automation/fleet-automation-pipeline-view.a669402744743088964b9801c2155281.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="View OTel Collector configurations with Pipeline Visualization in Fleet Automation" /%}

## Key features{% #key-features %}

- **Collector Configuration Visibility**: View the complete configuration of any OTel Collector in your infrastructure.
- **Build Information**: See Collector version, build details, and component information.
- **Local Inspection Endpoint**: Use an HTTP endpoint for local debugging and configuration verification.
- **Fleet Management**: Monitor and manage your OpenTelemetry Collector fleet from the Datadog UI.

## Setup{% #setup %}

{% alert level="danger" %}
If you use the [DDOT Collector](https://docs.datadoghq.com/opentelemetry/setup/ddot_collector.md), do **not** manually configure the Datadog Extension. It is automatically enabled in all DDOT Collector versions.
{% /alert %}

### 1. Add the Datadog Extension to your Collector configuration

Configure the Datadog Extension in your OpenTelemetry Collector configuration file:

```yaml
extensions:
  datadog:
    api:
      key: ${env:DD_API_KEY}
      site: 
    # hostname: "my-collector-host"  # Optional: must match Datadog Exporter hostname if set

service:
  extensions: [datadog]
```

### 2. Configure the Datadog Exporter

This feature requires the Datadog Exporter to be configured and enabled in an active pipeline (`traces` or `metrics`). The extension uses the exporter's telemetry to associate the Collector's configuration with a specific host in Datadog.

```yaml
exporters:
  datadog/exporter:
    api:
      key: ${env:DD_API_KEY}
      site: 
    # hostname: "my-collector-host"  # Optional: must match Datadog Extension hostname if set
```

### 3. Enable the extension in your service configuration

Add the Datadog Extension to your service extensions:

```yaml
service:
  extensions: [datadog]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [datadog/exporter]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [datadog/exporter]
```

### 4. (Optional) Add custom resource attributes

The Datadog Extension automatically collects resource attributes from the Collector's internal telemetry and includes them in the metadata payload it sends to Datadog. To attach custom attributes such as deployment environment, team, or Kubernetes cluster name, set them under `service.telemetry.resource`:

```yaml
service:
  telemetry:
    resource:
      deployment.environment.name: production
      team.name: platform
      k8s.cluster.name: prod-us-east1-cluster-a
```

The Collector automatically attaches `service.name`, `service.version`, and `service.instance.id` (a randomly generated UUID) to its internal telemetry. You don't need to set these manually.

## Configuration options{% #configuration-options %}

| Parameter                  | Description                                                                                                                                                                                                                                                            | Default          |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| `api.key`                  | Datadog API key (required).                                                                                                                                                                                                                                            | -                |
| `api.site`                 | Datadog site (for example, `us5.datadoghq.com`).                                                                                                                                                                                                                       | `datadoghq.com`  |
| `api.fail_on_invalid_key`  | Exit at startup if the API key is invalid.                                                                                                                                                                                                                             | `true`           |
| `hostname`                 | Custom hostname for the Collector.                                                                                                                                                                                                                                     | Auto-detected    |
| `http.endpoint`            | Local HTTP server endpoint.                                                                                                                                                                                                                                            | `localhost:9875` |
| `http.path`                | HTTP server path for metadata.                                                                                                                                                                                                                                         | `/metadata`      |
| `deployment_type`          | Deployment type for the Collector. One of: `gateway`, `daemonset`, or `unknown`.                                                                                                                                                                                       | `unknown`        |
| `installation_method`      | How the Collector was installed. One of: `kubernetes`, `bare-metal`, `docker`, `ecs-fargate`, `eks-fargate`, or unset. Available in Collector v0.148.0 and later.                                                                                                      | unset            |
| `gateway_service`          | Set on **gateway** Collectors only. The Kubernetes Service fronting the gateway Collector pods. Format: `service` or `namespace/service`. Available in Collector v0.150.0 and later.                                                                                   | -                |
| `gateway_destination`      | Set on **agent or DaemonSet** Collectors only. The Kubernetes Service that this Collector forwards telemetry to. Must match `gateway_service` on the receiving gateway Collector. Format: `service` or `namespace/service`. Available in Collector v0.150.0 and later. | -                |
| `proxy_url`                | HTTP proxy URL for outbound requests.                                                                                                                                                                                                                                  | -                |
| `timeout`                  | Timeout for HTTP requests.                                                                                                                                                                                                                                             | `30s`            |
| `tls.insecure_skip_verify` | Skip TLS certificate verification.                                                                                                                                                                                                                                     | `false`          |

{% alert level="danger" %}
**Hostname Matching**: If you specify a custom `hostname` in the Datadog Extension, it **must** match the `hostname` value in the Datadog Exporter configuration. The Datadog Extension does not have access to pipeline telemetry and cannot infer hostnames from incoming spans. It only obtains hostnames from system/cloud provider APIs or manual configuration. If telemetry has different [hostname attributes](https://docs.datadoghq.com/opentelemetry/config/hostname_tagging.md?tab=host) than the hostname reported by the extension, the telemetry will not be correlated to the correct host, and you may see duplicate hosts in Datadog.
{% /alert %}

### Complete configuration example{% #complete-configuration-example %}

```yaml
extensions:
  datadog:
    api:
      key: ${env:DD_API_KEY}
      site: 
    hostname: "my-collector-host"
    http:
      endpoint: "localhost:9875"
      path: "/metadata"
    proxy_url: "http://proxy.example.com:8080"
    timeout: 30s
    tls:
      insecure_skip_verify: false

exporters:
  datadog/exporter:
    api:
      key: ${env:DD_API_KEY}
      site: 
    hostname: "my-collector-host"

service:
  extensions: [datadog]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [datadog/exporter]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [datadog/exporter]
```

## Viewing Collector configuration{% #viewing-collector-configuration %}

Once configured, you can view your OpenTelemetry Collector configuration and build information in various locations:

### Fleet Automation{% #fleet-automation %}

1. Navigate to **[Integrations > Fleet Automation](https://app.datadoghq.com/fleet)**.
1. Filter for OTel Collector hosts using the Collector facets, then click a host.
1. In the side panel, select the **Info** tab to view build information.
1. Select the **Configurations** tab to view the full YAML file or a pipeline visualization of your OTel Collector configurations.

{% image
   source="https://docs.dd-static.net/images/agent/fleet_automation/fleet-automation-yaml-view.1973a6356b449819d1cf838e39a3d14a.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/agent/fleet_automation/fleet-automation-yaml-view.1973a6356b449819d1cf838e39a3d14a.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="View OTel Collector configuration YAMLs in Fleet Automation" /%}

### Infrastructure List (Host List){% #infrastructure-list-host-list %}

1. Navigate to **[Infrastructure > Hosts](https://app.datadoghq.com/infrastructure)** in your Datadog account.
1. Click on any host running the OpenTelemetry Collector (**Note**: Filter by `field:apps:otel` to only show Collector instances).
1. In the host details panel, select the **OTel Collector** tab to see build info and full Collector configuration.

### Resource Catalog{% #resource-catalog %}

1. Navigate to **[Infrastructure > Resource Catalog](https://app.datadoghq.com/infrastructure/catalog)** in your Datadog account
1. Filter for hosts or search for your Collector instances.
1. Click on any host running the OpenTelemetry Collector.
1. Scroll down to **Collector** to see build info and full Collector configuration.

## Local HTTP server{% #local-http-server %}

The Datadog Extension includes a local HTTP server for debugging and inspection:

```bash
# Access collector metadata locally
curl http://localhost:9875/metadata
```

This endpoint provides:

- Collector configuration (scrubbed of sensitive information)
- Build information and version details
- Active component list
- Extension status

## Troubleshooting{% #troubleshooting %}

### Configuration not appearing in Datadog{% #configuration-not-appearing-in-datadog %}

1. **Check hostname matching**: Ensure hostnames match between the Datadog Extension and Datadog Exporter.
1. **Verify API key**: Confirm the API key is valid and has appropriate permissions.
1. **Check Collector logs**: Look for extension initialization and data submission logs.
1. **Confirm extension is enabled**: Verify the extension is listed in the service configuration.

### HTTP server issues{% #http-server-issues %}

1. **Port conflicts**: Ensure port 9875 is available or configure a different port.
1. **Network access**: Verify the HTTP server is accessible from your debug location.
1. **Check logs**: Review extension logs for HTTP server startup issues.

## Further reading{% #further-reading %}

- [Setting Up the OpenTelemetry Collector](https://docs.datadoghq.com/opentelemetry/setup/collector_exporter.md)
- [Infrastructure List](https://docs.datadoghq.com/infrastructure/list.md)
- [Resource Catalog](https://docs.datadoghq.com/infrastructure/resource_catalog.md)
