---
title: Datadog Agent Source
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Observability Pipelines > Sources > Datadog Agent Source
---

# Datadog Agent Source

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site). ().
{% /alert %}

{% /callout %}
Available for:
{% icon name="icon-logs" /%}
 Logs | 
{% icon name="icon-metrics" /%}
 Metrics 
{% callout %}
##### Join the Preview!

Sending metrics to Observability Pipelines is in Preview. Fill out the form to request access.

[Request Access](https://www.datadoghq.com/product-preview/metrics-ingestion-and-cardinality-control-in-observability-pipelines/)
{% /callout %}

## Overview{% #overview %}

Use Observability Pipelines' Datadog Agent source to receive logs or metrics (Preview (PREVIEW indicates an early access version of a major product or feature that you can opt into before its official release.)) from the Datadog Agent.

**Note**: If you are using the Datadog Distribution of OpenTelemetry (DDOT) Collector to collect logs or metrics, you must [use the OpenTelemetry source to send that data to Observability Pipelines](https://docs.datadoghq.com/observability_pipelines/sources/opentelemetry/#send-data-from-the-datadog-distribution-of-opentelemetry-collector-to-observability-pipelines).

## Prerequisites{% #prerequisites %}

You already have the Datadog Agent installed to collect and route your logs and/or metrics to Datadog. If you do not have Datadog Agents set up, see the [Datadog Agent documentation](https://docs.datadoghq.com/agent/) for more information.

You have the following information available:

- A Datadog API key with [Remote Configuration enabled](https://docs.datadoghq.com/agent/remote_config/?tab=configurationyamlfile#setup).
- Your Datadog [`Site URL`](https://docs.datadoghq.com/getting_started/site/). For example, `datadoghq.com` for the site `US1`.

## Setup{% #setup %}

Set up this source when you [set up a pipeline](https://docs.datadoghq.com/observability_pipelines/configuration/set_up_pipelines/). You can set up a pipeline in the [UI](https://app.datadoghq.com/observability-pipelines), using the [API](https://docs.datadoghq.com/api/latest/observability-pipelines/), or with [Terraform](https://registry.terraform.io/providers/datadog/datadog/latest/docs/resources/observability_pipeline). The instructions in this section are for setting up the source in the UI.

Select and set up this source when you [set up a pipeline](https://docs.datadoghq.com/observability_pipelines/configuration/set_up_pipelines/). The information below is for the source settings in the pipeline UI.

To configure your Datadog Agent source:

{% alert level="danger" %}
Only enter the identifier for the Datadog Agent address and, if applicable, the TLS key pass. Do not enter the actual values.
{% /alert %}

Enter the identifier for your Datadog Agent address. If you leave it blank, the default is used.

### Optional TLS settings{% #optional-tls-settings %}

Toggle the switch to **Enable TLS**. The following certificate and key files are required.**Note**: All file paths are made relative to the configuration data directory, which is `/var/lib/observability-pipelines-worker/config/` by default. See [Advanced Worker Configurations](https://docs.datadoghq.com/observability_pipelines/configuration/install_the_worker/advanced_worker_configurations/) for more information. The file must be owned by the `observability-pipelines-worker` user and group, or at least readable by the group or user.

- Enter the identifier for your Datadog Agent key pass. If you leave it blank, the default is used.
  - **Note**: Only enter the identifier for the key pass. Do **not** enter the actual key pass.
- `Server Certificate Path`: The path to the certificate file that has been signed by your Certificate Authority (CA) root file in DER or PEM (X.509) format.
- `CA Certificate Path`: The path to the certificate file that is your Certificate Authority (CA) root file in DER or PEM (X.509) format.
- `Private Key Path`: The path to the `.key` private key file that belongs to your Server Certificate Path in DER or PEM (PKCS#8) format.

## Set secrets{% #set-secrets %}

These are the defaults used for secret identifiers and environment variables.

**Note**: If you enter secret identifiers and then choose to use environment variables, the environment variable is the identifier entered and prepended with `DD_OP`. For example, if you entered `PASSWORD_1` for a password identifier, the environment variable for that password is `DD_OP_PASSWORD_1`.

{% tab title="Secrets Management" %}

- Datadog Agent address identifier:
  - References the bind address on which the Observability Pipelines Worker listens to receive logs from the Datadog Agent.
  - The default identifier is `SOURCE_DATADOG_AGENT_ADDRESS`.
- Datadog Agent TLS passphrase identifier (when TLS is enabled):
  - The default identifier is `SOURCE_DATADOG_AGENT_KEY_PASS`.

{% /tab %}

{% tab title="Environment Variables" %}

- Datadog Agent address:
  - The Observability Pipelines Worker listens to this socket address to receive logs from the Datadog Agent.
  - The default environment variable is `DD_OP_SOURCE_DATADOG_AGENT_ADDRESS`.
- Datadog Agent TLS passphrase (when enabled):
  - The default environment variable is `DD_OP_SOURCE_DATADOG_AGENT_KEY_PASS`.

{% /tab %}

## Connect the Datadog Agent to the Observability Pipelines Worker{% #connect-the-datadog-agent-to-the-observability-pipelines-worker %}

{% tab title="Logs" %}
Use the Agent configuration file or the Agent Helm chart values file to connect the Datadog Agent to the Observability Pipelines Worker.

**Note**: If your Agent is running in a Docker container, you must exclude Observability Pipelines logs using the `DD_CONTAINER_EXCLUDE_LOGS` environment variable. For Helm, use `datadog.containerExcludeLogs`. This prevents duplicate logs, as the Worker also sends its own logs directly to Datadog. See [Docker Log Collection](https://docs.datadoghq.com/containers/docker/log/?tab=containerinstallation#linux) or [Setting environment variables for Helm](https://docs.datadoghq.com/containers/guide/container-discovery-management/?tab=helm#setting-environment-variables) for more information.

{% collapsible-section #id-for-anchoring %}
#### Agent configuration file

To send Datadog Agent logs to the Observability Pipelines Worker, update your [Agent configuration file](https://github.com/DataDog/datadog-agent/blob/main/pkg/config/config_template.yaml) with the following:

```
observability_pipelines_worker:
  logs:
    enabled: true
    url: "http://<OPW_HOST>:8282"
```

`<OPW_HOST>` is the host IP address or the load balancer URL associated with the Observability Pipelines Worker.

For CloudFormation installs, use the `LoadBalancerDNS` CloudFormation output for the URL.

For Kubernetes installs, you can use the internal DNS record of the Observability Pipelines Worker service. For example: `http://opw-observability-pipelines-worker.default.svc.cluster.local:<PORT>`.

After you [restart the Agent](https://docs.datadoghq.com/agent/configuration/agent-commands/#restart-the-agent), your observability data should be going to the Worker, processed by the pipeline, and delivered to Datadog.
{% /collapsible-section %}

{% collapsible-section #id-for-anchoring %}
#### Agent Helm values file

To send Datadog Agent logs to the Observability Pipelines Worker, update your Datadog Helm chart [`datadog-values.yaml`](https://github.com/DataDog/helm-charts/blob/main/charts/datadog/values.yaml) with the following environment variables. See [Agent Environment Variables](https://docs.datadoghq.com/agent/guide/environment-variables/) for more information.

```
datadog:
  env:
    - name: DD_OBSERVABILITY_PIPELINES_WORKER_LOGS_ENABLED
      value: true
    - name: DD_OBSERVABILITY_PIPELINES_WORKER_LOGS_URL
      value: "http://<OPW_HOST>:8282"
```

`<OPW_HOST>` is the IP/URL of the host (or load balancer) associated with the Observability Pipelines Worker.

For Kubernetes installs, you can use the internal DNS record of the Observability Pipelines Worker service. For example: `http://opw-observability-pipelines-worker.default.svc.cluster.local:<PORT>`.
{% /collapsible-section %}

{% /tab %}

{% tab title="Metrics" %}
Use the Agent configuration file or the Agent Helm chart values file to connect the Datadog Agent to the Observability Pipelines Worker.

**Note**: If your Agent is running in a Docker container, you must exclude Observability Pipelines metrics, such as utilization and events in/out metrics, using the `DD_CONTAINER_EXCLUDE_METRICS` environment variable. For Helm, use `datadog.containerExcludeMetrics`. This prevents duplicate metrics, as the Worker also sends its own metrics directly to Datadog. See [Docker Metrics Collection](https://docs.datadoghq.com/containers/docker/data_collected/) or [Setting environment variables for Helm](https://docs.datadoghq.com/containers/guide/container-discovery-management/?tab=helm#setting-environment-variables) for more information.

{% collapsible-section #id-for-anchoring %}
#### Agent configuration file

To send Datadog Agent metrics to the Observability Pipelines Worker, update your [Agent configuration file](https://github.com/DataDog/datadog-agent/blob/main/pkg/config/config_template.yaml) with the following:

```
observability_pipelines_worker:
  metrics:
    enabled: true
    url: "http://<OPW_HOST>:8383"
```

`<OPW_HOST>` is the host IP address or the load balancer URL associated with the Observability Pipelines Worker.

- For CloudFormation installs, use the `LoadBalancerDNS` CloudFormation output for the URL.
- For Kubernetes installs, you can use the internal DNS record of the Observability Pipelines Worker service. For example: `http://opw-observability-pipelines-worker.default.svc.cluster.local:<PORT>`.

**Note**: If the Worker is listening for logs on port 8282, you must use another port for metrics, such as 8383.

After you [restart the Agent](https://docs.datadoghq.com/agent/configuration/agent-commands/#restart-the-agent), your observability data should be going to the Worker, processed by the pipeline, and delivered to Datadog.
{% /collapsible-section %}

{% collapsible-section #id-for-anchoring %}
#### Agent Helm values file

To send Datadog Agent metrics to the Observability Pipelines Worker, update your Datadog Helm chart [datadog-values.yaml](https://github.com/DataDog/helm-charts/blob/main/charts/datadog/values.yaml) with the following environment variables. See [Agent Environment Variables](https://docs.datadoghq.com/agent/guide/environment-variables/) for more information.

```
datadog:
  env:
    - name: DD_OBSERVABILITY_PIPELINES_WORKER_METRICS_ENABLED
      value: true
    - name: DD_OBSERVABILITY_PIPELINES_WORKER_METRICS_URL
      value: "http://<OPW_HOST>:8383"
```

`<OPW_HOST>` is the host IP address or the load balancer URL associated with the Observability Pipelines Worker.

For Kubernetes installs, you can use the internal DNS record of the Observability Pipelines Worker service. For example: `http://opw-observability-pipelines-worker.default.svc.cluster.local:<PORT>`.

**Note**: If the Worker is listening for logs on port 8282, you must use another port for metrics, such as 8383.
{% /collapsible-section %}

{% /tab %}

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

- [Manage metric volume and tags in your environment with Observability Pipelines](https://www.datadoghq.com/blog/manage-metrics-cost-control-with-observability-pipelines)
