---
title: Install the DDOT Collector on Kubernetes
description: >-
  Deploy the DDOT Collector on Kubernetes with the OpenTelemetry Operator or the
  OpenTelemetry Collector Helm chart, and check that your data reaches Datadog.
breadcrumbs: >-
  Docs > OpenTelemetry in Datadog > Send OpenTelemetry Data to Datadog > DDOT
  Collector > Install the DDOT Collector on Kubernetes
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Install the DDOT Collector on Kubernetes

{% callout %}
The DDOT Collector is in Preview.
{% /callout %}

## Overview{% #overview %}

Deploy the Datadog OpenTelemetry (DDOT) Collector on Kubernetes with the OpenTelemetry Operator or the OpenTelemetry Collector Helm chart. When you finish, a Collector runs on each node, receives OTLP from your applications, and sends your telemetry to Datadog. You don't need the Datadog Agent.

Already run the upstream OpenTelemetry Collector? To switch it to the DDOT Collector by changing its image, see [Migrate to the DDOT Collector](https://docs.datadoghq.com/opentelemetry/migrate/upstream_to_ddot_collector.md).

## Requirements{% #requirements %}

**Datadog account**:

1. [Create a Datadog account](https://www.datadoghq.com/free-datadog-trial/) if you don't have one.
1. Find or create your [Datadog API key](https://app.datadoghq.com/organization-settings/api-keys/).

**Software**:

- A Kubernetes cluster (v1.29+)
- [Helm (v4+)](https://helm.sh)
- [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)

**Cluster policy**: The Collector publishes its OTLP ports on each node with `hostPort`, and container log collection reads node files with `hostPath` volumes. The Kubernetes [baseline Pod Security Standard](https://kubernetes.io/docs/concepts/security/pod-security-standards/#baseline) doesn't allow either one, so run the Collector in a namespace that allows them.

**Network**: Application pods reach the Collector on these ports:

| Protocol | Transport | Port |
| -------- | --------- | ---- |
| gRPC     | TCP       | 4317 |
| HTTP     | TCP       | 4318 |

## Install the DDOT Collector{% #install-the-ddot-collector %}

The commands in this guide use your current namespace. Create the Collector and its API key secret in the same namespace. cert-manager, if you install it, goes in its own `cert-manager` namespace.

### Choose an installation method{% #choose-an-installation-method %}

Choose one of these installation methods:

- [OpenTelemetry Operator](https://opentelemetry.io/docs/platforms/kubernetes/operator/): Manages the Collector as a Kubernetes resource and keeps it running as you declared it. The Operator can also inject SDKs into your pods.
- [Helm chart](https://opentelemetry.io/docs/platforms/kubernetes/helm/collector/): Installs the Collector from a values file, without the Operator.

{% tab title="Operator" %}
### Install the OpenTelemetry Operator{% #install-the-opentelemetry-operator %}

The default OpenTelemetry Operator installation uses [cert-manager](https://cert-manager.io/docs/installation/) to manage the TLS certificate for the Operator's admission webhook. If cert-manager isn't installed in your cluster, install it:

```shell
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager --version v1.21.3 \
     --namespace cert-manager --create-namespace \
     --set crds.enabled=true --wait
```

Install the OpenTelemetry Operator with the [OpenTelemetry Operator Helm chart](https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-operator/README.md):

```shell
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo update
helm install opentelemetry-operator open-telemetry/opentelemetry-operator   \
     --version 0.127.0                                                      \
     --set "manager.createRbacPermissions=true"                             \
     --set "manager.collectorImage.repository=datadog/ddot-collector"       \
     --set "manager.collectorImage.tag=7.85.3"
```

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



{% alert level="info" %}
For FED, set the tag to `7.85.3-fips` to use the FIPS-compliant DDOT image. See [FIPS compliance](https://docs.datadoghq.com/agent/configuration/fips-compliance.md).
{% /alert %}


{% /callout %}

Wait for the Operator to be ready before you continue:

```shell
kubectl rollout status deployment/opentelemetry-operator --timeout=5m
```

{% /tab %}

{% tab title="Helm" %}
### Add the OpenTelemetry Helm repository{% #add-the-opentelemetry-helm-repository %}

Add the OpenTelemetry Helm repository:

```shell
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm repo update
```

{% /tab %}

### Store your Datadog API key{% #store-your-datadog-api-key %}

1. Get the Datadog [API key](https://app.datadoghq.com/organization-settings/api-keys/).
1. Confirm the **DATADOG SITE** selected on the right (Current value: **{% placeholder "user-datadog-site-name" /%}**) corresponds to your [Datadog site](https://docs.datadoghq.com/getting_started/site.md).
1. Store the API key as a Kubernetes secret:
   ```shell
   kubectl create secret generic datadog-secret \
     --from-literal api-key=<DD_API_KEY>        \
     --from-literal site=<YOUR_DATADOG_SITE>
   ```
Replace `<DD_API_KEY>` with your Datadog API key.

### Configure the Collector{% #configure-the-collector %}

Set `DD_HOSTNAME` so that each node reports a consistent hostname. The Operator example on this page builds it from the `K8S_NODE_NAME` and `K8S_CLUSTER_NAME` variables:

```yaml
- name: K8S_CLUSTER_NAME
  value: <CLUSTER_NAME>
- name: K8S_NODE_NAME
  valueFrom:
    fieldRef:
      fieldPath: spec.nodeName
- name: DD_HOSTNAME
  value: $(K8S_NODE_NAME)-$(K8S_CLUSTER_NAME)
```

Keep `K8S_CLUSTER_NAME` and `K8S_NODE_NAME` above `DD_HOSTNAME`, because Kubernetes expands variable references only from variables defined earlier in the list. The Collector Helm chart already defines `OTEL_K8S_NODE_NAME` before your `extraEnvs`, so the Helm example sets `DD_HOSTNAME` to `$(OTEL_K8S_NODE_NAME)-$(K8S_CLUSTER_NAME)` without defining a node name variable. Replace `<CLUSTER_NAME>` with your cluster's name. Datadog uses the same `<NODE_NAME>-<CLUSTER_NAME>` name for the node's Kubernetes metrics, so each node appears as one host.

{% tab title="Operator" %}
After deploying the OTel Operator, create the `OpenTelemetryCollector` resource that triggers the deployment of the Collector.

1. Use the `node-collector.yaml` file to specify your `OpenTelemetryCollector` daemonset configuration.

In the `node-collector.yaml` file:

```yaml
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
  name: node-collector
spec:
  # Deploy 1 instance per node, that will collect telemetry from that node's pods
  mode: daemonset
  config:
    exporters:
      datadog:
        api:
          key: ${env:DD_API_KEY}
          site: ${env:DD_SITE}
        sending_queue:
          batch:
            flush_timeout: 10s
    service:
      telemetry:
        resource:
          k8s.cluster.name: ${env:K8S_CLUSTER_NAME}
  env:
    - name: DD_API_KEY
      valueFrom:
        secretKeyRef:
          key: api-key
          name: datadog-secret
    - name: DD_SITE
      valueFrom:
        secretKeyRef:
          key: site
          name: datadog-secret
    - name: DD_OTELCOLLECTOR_CONVERTER_FEATURES
      value: datadog,pprof,zpages,prometheus,infraattributes
    - name: K8S_CLUSTER_NAME
      value: <CLUSTER_NAME>
    - name: K8S_NODE_NAME
      valueFrom:
        fieldRef:
          fieldPath: spec.nodeName
    - name: DD_HOSTNAME
      value: $(K8S_NODE_NAME)-$(K8S_CLUSTER_NAME)
```

Replace `<CLUSTER_NAME>` with your cluster's name.
Add an OTLP receiver, the Datadog Connector, and the cluster-name processor, and define a pipeline for each signal. Publish the OTLP ports on the node with `hostPort` so that application pods can reach the Collector instance running on the same node.
The Datadog Connector computes APM trace metrics from your traces. Datadog needs these metrics to show your service's requests, errors, and latency. The `resource/add-cluster-name` processor adds `k8s.cluster.name` to all telemetry, which Datadog maps to the `kube_cluster_name` tag.

In the `node-collector.yaml` file:

```yaml
# [...]
spec:
  # [...]
  # Publish the OTLP ports on the node's network interface
  ports:
    - name: otlp-grpc
      port: 4317
      protocol: TCP
      hostPort: 4317
    - name: otlp-http
      port: 4318
      protocol: TCP
      hostPort: 4318
  config:
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
          http:
            endpoint: 0.0.0.0:4318
    processors:
      infraattributes:
        cardinality: 2
      resource/add-cluster-name:
        attributes:
          - key: k8s.cluster.name
            value: ${env:K8S_CLUSTER_NAME}
            action: upsert
    connectors:
      datadog/connector:
        traces:
          compute_top_level_by_span_kind: true
          peer_tags_aggregation: true
          compute_stats_by_span_kind: true
    # [...]
    service:
      # [...]
      pipelines:
        logs:
          receivers: ['otlp']
          processors: ['resource/add-cluster-name', 'infraattributes']
          exporters: ['datadog']
        metrics:
          receivers: ['otlp', 'datadog/connector']
          processors: ['resource/add-cluster-name', 'infraattributes']
          exporters: ['datadog']
        traces:
          receivers: ['otlp']
          processors: ['resource/add-cluster-name', 'infraattributes']
          exporters: ['datadog', 'datadog/connector']
```
(Optional) Collect host and kubelet metrics, and add a health check:
{% alert level="warning" %}
Host and kubelet metrics send more data to Datadog and can add to your bill. See the [pricing page](https://www.datadoghq.com/pricing/).
{% /alert %}

In the `node-collector.yaml` file:

```yaml
spec:
  config:
    receivers:
      host_metrics:
        collection_interval: 15s
        scrapers:
          cpu: {}
          load: {}
          memory: {}
          network: {}
          disk: {}
      kubelet_stats:
        auth_type: serviceAccount
        collection_interval: 15s
        endpoint: ${env:K8S_NODE_NAME}:10250
        node: ${env:K8S_NODE_NAME}
        metric_groups:
          - pod
          - container
          - volume
    extensions:
      health_check:
        endpoint: "${env:K8S_POD_IP}:13133"
    # [...]
    service:
      # [...]
      extensions: ['health_check']
      pipelines:
        metrics:
          receivers: ['host_metrics', 'otlp', 'kubelet_stats', 'datadog/connector']
          # [...]
  env:
    # [...]
    - name: K8S_POD_IP
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: status.podIP
    # K8S_NODE_NAME is defined in step 1
```
(Optional) Collect container logs from the node's file system:
{% alert level="warning" %}
Container logs send more data to Datadog and can add to your bill. See the [pricing page](https://www.datadoghq.com/pricing/).
{% /alert %}

The `filelog` receiver reads container logs from the node. Because the Operator does not mount host paths automatically, add the log directories as read-only volumes:

In the `node-collector.yaml` file:

```yaml
spec:
  config:
    receivers:
      filelog:
        include:
          - /var/log/pods/*/*/*.log
        # Exclude the Collector's own logs to avoid a feedback loop
        exclude:
          - /var/log/pods/*_node-collector-collector-*_*/otc-container/*.log
        start_at: end
        include_file_path: true
        include_file_name: false
        retry_on_failure:
          enabled: true
        operators:
          - id: container-parser
            type: container
            max_log_size: 102400
    # [...]
    service:
      # [...]
      pipelines:
        logs:
          receivers: ['otlp', 'filelog']
          # [...]
  # Mount the node's log directories into the Collector pod (read-only)
  volumes:
    - name: varlogpods
      hostPath:
        path: /var/log/pods
    - name: varlibdockercontainers
      hostPath:
        path: /var/lib/docker/containers
  volumeMounts:
    - name: varlogpods
      mountPath: /var/log/pods
      readOnly: true
    - name: varlibdockercontainers
      mountPath: /var/lib/docker/containers
      readOnly: true
```

{% collapsible-section %}
Complete node-collector.yaml, with the optional host metrics, kubelet metrics, and container logs
Your `node-collector.yaml` file should look something like this:

In the `node-collector.yaml` file:

```yaml
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
  name: node-collector
spec:
  # Deploy 1 instance per node, that will collect telemetry from that node's pods
  mode: daemonset
  # Publish the OTLP ports on the node's network interface
  ports:
    - name: otlp-grpc
      port: 4317
      protocol: TCP
      hostPort: 4317
    - name: otlp-http
      port: 4318
      protocol: TCP
      hostPort: 4318
  config:
    receivers:
      otlp:
        protocols:
          grpc:
            endpoint: 0.0.0.0:4317
          http:
            endpoint: 0.0.0.0:4318
      host_metrics:
        collection_interval: 15s
        scrapers:
          cpu: {}
          load: {}
          memory: {}
          network: {}
          disk: {}
      kubelet_stats:
        auth_type: serviceAccount
        collection_interval: 15s
        endpoint: ${env:K8S_NODE_NAME}:10250
        node: ${env:K8S_NODE_NAME}
        metric_groups:
          - pod
          - container
          - volume
      filelog:
        include:
          - /var/log/pods/*/*/*.log
        exclude:
          - /var/log/pods/*_node-collector-collector-*_*/otc-container/*.log
        start_at: end
        include_file_path: true
        include_file_name: false
        retry_on_failure:
          enabled: true
        operators:
          - id: container-parser
            type: container
            max_log_size: 102400
    processors:
      infraattributes:
        cardinality: 2
      resource/add-cluster-name:
        attributes:
          - key: k8s.cluster.name
            value: ${env:K8S_CLUSTER_NAME}
            action: upsert
    connectors:
      datadog/connector:
        traces:
          compute_top_level_by_span_kind: true
          peer_tags_aggregation: true
          compute_stats_by_span_kind: true
    exporters:
      datadog:
        api:
          key: ${env:DD_API_KEY}
          site: ${env:DD_SITE}
        sending_queue:
          batch:
            flush_timeout: 10s
    extensions:
      health_check:
        endpoint: "${env:K8S_POD_IP}:13133"
    service:
      telemetry:
        resource:
          k8s.cluster.name: ${env:K8S_CLUSTER_NAME}
      extensions: ['health_check']
      pipelines:
        logs:
          receivers: ['otlp', 'filelog']
          processors: ['resource/add-cluster-name', 'infraattributes']
          exporters: ['datadog']
        metrics:
          receivers: ['host_metrics', 'otlp', 'kubelet_stats', 'datadog/connector']
          processors: ['resource/add-cluster-name', 'infraattributes']
          exporters: ['datadog']
        traces:
          receivers: ['otlp']
          processors: ['resource/add-cluster-name', 'infraattributes']
          exporters: ['datadog', 'datadog/connector']
  env:
    - name: DD_API_KEY
      valueFrom:
        secretKeyRef:
          key: api-key
          name: datadog-secret
    - name: DD_SITE
      valueFrom:
        secretKeyRef:
          key: site
          name: datadog-secret
    - name: DD_OTELCOLLECTOR_CONVERTER_FEATURES
      value: datadog,pprof,zpages,prometheus,infraattributes
    - name: K8S_CLUSTER_NAME
      value: <CLUSTER_NAME>
    - name: K8S_NODE_NAME
      valueFrom:
        fieldRef:
          fieldPath: spec.nodeName
    - name: DD_HOSTNAME
      value: $(K8S_NODE_NAME)-$(K8S_CLUSTER_NAME)
    - name: K8S_POD_IP
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: status.podIP
  # Mount the node's log directories for the filelog receiver (read-only)
  volumes:
    - name: varlogpods
      hostPath:
        path: /var/log/pods
    - name: varlibdockercontainers
      hostPath:
        path: /var/lib/docker/containers
  volumeMounts:
    - name: varlogpods
      mountPath: /var/log/pods
      readOnly: true
    - name: varlibdockercontainers
      mountPath: /var/lib/docker/containers
      readOnly: true
```

Replace `<CLUSTER_NAME>` with your cluster's name.
{% /collapsible-section %}

{% /tab %}

{% tab title="Helm" %}
Use a YAML file to specify the Helm chart parameters for the [Collector chart](https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-collector/README.md).

1. Create an empty `node-collector-values.yaml` file:

```shell
touch node-collector-values.yaml
```

{% alert level="info" %}
Unspecified parameters use defaults from [values.yaml](https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-collector/values.yaml).
{% /alert %}
Choose the daemonset mode and use DDOT as the collector:
In the `node-collector-values.yaml` file:

```yaml
mode: daemonset
image:
  repository: datadog/ddot-collector
  tag: 7.85.3
ports:
  jaeger-compact:
    enabled: false
  jaeger-grpc:
    enabled: false
  jaeger-thrift:
    enabled: false
  zipkin:
    enabled: false
```

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



{% alert level="info" %}
For FED, set `tag: 7.85.3-fips` to use the FIPS-compliant DDOT image. See [FIPS compliance](https://docs.datadoghq.com/agent/configuration/fips-compliance.md).
{% /alert %}


{% /callout %}

{% alert level="info" %}
The Collector Helm chart publishes the OTLP ports on each node by default (`hostPort: 4317` for gRPC and `hostPort: 4318` for HTTP), so application pods can reach the Collector instance running on the same node. See Instrument your application.
{% /alert %}
Configure the Datadog exporter and API key secret:
In the `node-collector-values.yaml` file:

```yaml
config:
  exporters:
    datadog:
      api:
        key: ${env:DD_API_KEY}
        site: ${env:DD_SITE}
      sending_queue:
        batch:
          flush_timeout: 10s
extraEnvs:
  - name: DD_API_KEY
    valueFrom:
      secretKeyRef:
        key: api-key
        name: datadog-secret
  - name: DD_SITE
    valueFrom:
      secretKeyRef:
        key: site
        name: datadog-secret
  - name: DD_OTELCOLLECTOR_CONVERTER_FEATURES
    value: datadog,pprof,zpages,prometheus,infraattributes
  - name: K8S_CLUSTER_NAME
    value: <CLUSTER_NAME>
  # The chart defines OTEL_K8S_NODE_NAME before extraEnvs
  - name: DD_HOSTNAME
    value: $(OTEL_K8S_NODE_NAME)-$(K8S_CLUSTER_NAME)
```

Replace `<CLUSTER_NAME>` with your cluster's name.
(Optional) Collect host metrics, kubelet metrics, and container logs with the chart's presets:
{% alert level="warning" %}
Host metrics, kubelet metrics, and container logs send more data to Datadog and can add to your bill. See the [pricing page](https://www.datadoghq.com/pricing/).
{% /alert %}

In the `node-collector-values.yaml` file:

```yaml
presets:
  hostMetrics:
    enabled: true
  kubeletMetrics:
    enabled: true
  logsCollection:
    enabled: true
    includeCollectorLogs: false
```
Define pipelines for desired signals, with an OTLP receiver:
In the `node-collector-values.yaml` file:

```yaml
config:
  # [...]
  receivers:
    otlp:
      protocols:
        grpc:
          endpoint: 0.0.0.0:4317
        http:
          endpoint: 0.0.0.0:4318
  service:
    pipelines:
      logs:
        receivers: ['otlp']
        exporters: ['datadog']
      metrics:
        receivers: ['otlp']
        exporters: ['datadog']
      traces:
        receivers: ['otlp']
        exporters: ['datadog']
    telemetry:
      resource:
        k8s.cluster.name: ${env:K8S_CLUSTER_NAME}
```
Add the Datadog Connector and the cluster-name processor to the pipelines.
The Datadog Connector computes APM trace metrics from your traces. Datadog needs these metrics to show your service's requests, errors, and latency. The `resource/add-cluster-name` processor adds `k8s.cluster.name` to all telemetry, which Datadog maps to the `kube_cluster_name` tag.

In the `node-collector-values.yaml` file:

```yaml
config:
  # [...]
  processors:
    infraattributes:
      cardinality: 2
    resource/add-cluster-name:
      attributes:
        - key: k8s.cluster.name
          value: ${env:K8S_CLUSTER_NAME}
          action: upsert
  connectors:
    datadog/connector:
      traces:
        compute_top_level_by_span_kind: true
        peer_tags_aggregation: true
        compute_stats_by_span_kind: true
  service:
    pipelines:
      logs:
        # [...]
        processors: ['resource/add-cluster-name', 'infraattributes']
      metrics:
        receivers: ['otlp', 'datadog/connector']
        processors: ['resource/add-cluster-name', 'infraattributes']
        # [...]
      traces:
        # [...]
        processors: ['resource/add-cluster-name', 'infraattributes']
        exporters: ['datadog', 'datadog/connector']
```

{% collapsible-section %}
Complete node-collector-values.yaml, with the optional host metrics, kubelet metrics, and container logs
Your `node-collector-values.yaml` file should look something like this:

In the `node-collector-values.yaml` file:

```yaml
mode: daemonset
image:
  repository: datadog/ddot-collector
  tag: 7.85.3
presets:
  hostMetrics: # Add an hostmetrics receiver to the metrics pipeline
    enabled: true
  kubeletMetrics: # Add a kubeletstats receiver to the metrics pipeline
    enabled: true
  logsCollection: # Add a filelog receiver to the logs pipeline
    enabled: true
    includeCollectorLogs: false
config:
  connectors:
    datadog/connector:
      traces:
        compute_top_level_by_span_kind: true
        peer_tags_aggregation: true
        compute_stats_by_span_kind: true
  exporters:
    datadog:
      api:
        key: ${env:DD_API_KEY}
        site: ${env:DD_SITE}
      sending_queue:
        batch:
          flush_timeout: 10s
  processors:
    infraattributes:
      cardinality: 2
    resource/add-cluster-name:
      attributes:
        - key: k8s.cluster.name
          value: ${env:K8S_CLUSTER_NAME}
          action: upsert
  receivers:
    otlp:
      protocols:
        grpc:
          endpoint: 0.0.0.0:4317
        http:
          endpoint: 0.0.0.0:4318
  service:
    extensions:
      - health_check
    pipelines:
      logs:
        receivers:
          - otlp
        processors:
          - resource/add-cluster-name
          - infraattributes
        exporters:
          - datadog
      metrics:
        receivers:
          - otlp
          - datadog/connector
        processors:
          - resource/add-cluster-name
          - infraattributes
        exporters:
          - datadog
      traces:
        receivers:
          - otlp
        processors:
          - resource/add-cluster-name
          - infraattributes
        exporters:
          - datadog
          - datadog/connector
    telemetry:
      resource:
        k8s.cluster.name: ${env:K8S_CLUSTER_NAME}
extraEnvs:
  - name: DD_API_KEY
    valueFrom:
      secretKeyRef:
        key: api-key
        name: datadog-secret
  - name: DD_SITE
    valueFrom:
      secretKeyRef:
        key: site
        name: datadog-secret
  - name: DD_OTELCOLLECTOR_CONVERTER_FEATURES
    value: datadog,pprof,zpages,prometheus,infraattributes
  - name: K8S_CLUSTER_NAME
    value: <CLUSTER_NAME>
  # The chart defines OTEL_K8S_NODE_NAME before extraEnvs
  - name: DD_HOSTNAME
    value: $(OTEL_K8S_NODE_NAME)-$(K8S_CLUSTER_NAME)
ports:
  jaeger-compact:
    enabled: false
  jaeger-grpc:
    enabled: false
  jaeger-thrift:
    enabled: false
  zipkin:
    enabled: false
```

{% /collapsible-section %}

{% /tab %}

### Deploy the Collector{% #deploy-the-collector %}

{% tab title="Operator" %}
Apply the `node-collector.yaml` file to create the `OpenTelemetryCollector` resource. The Operator deploys the Collector as a DaemonSet, running one instance per node:

```shell
kubectl apply -f node-collector.yaml
```

Wait for the Collector to run on every node:

```shell
kubectl rollout status daemonset/node-collector-collector --timeout=5m
```

{% /tab %}

{% tab title="Helm" %}
Install the OpenTelemetry Collector chart with your values file:

```shell
helm install node-collector open-telemetry/opentelemetry-collector --version 0.177.0 -f node-collector-values.yaml
```

Wait for the Collector to run on every node:

```shell
kubectl rollout status daemonset/node-collector-opentelemetry-collector-agent --timeout=5m
```

To apply later changes, run `helm upgrade node-collector open-telemetry/opentelemetry-collector --version 0.177.0 -f node-collector-values.yaml`.
{% /tab %}

## Instrument your application{% #instrument-your-application %}

Instrument your application with a DDOT SDK or an upstream OpenTelemetry SDK. Either one sends OTLP to the Collector on the application's node, which publishes the OTLP ports on the node.

### DDOT SDK{% #ddot-sdk %}

Activate OpenTelemetry mode in the DDOT SDK for your language, as described in [Activate OpenTelemetry mode](https://docs.datadoghq.com/opentelemetry/instrument/ddot_sdks.md#enable-otlp-trace-export). Set `OTEL_EXPORTER_OTLP_ENDPOINT` to the Collector on the node, as in the upstream OpenTelemetry SDK example. Then continue to Verify the setup.

### Upstream OpenTelemetry SDK{% #upstream-opentelemetry-sdk %}

Instrument your application with an [upstream OpenTelemetry SDK](https://docs.datadoghq.com/opentelemetry/instrument/upstream_otel_sdks.md). Add these variables to your application container's `env` list. If your application already sets `OTEL_EXPORTER_OTLP_ENDPOINT`, update it to point to this Collector. The variables send OTLP over HTTP to the Collector on the node, and set the `service`, `env`, and `version` tags on your data:

In the `deployment.yaml` file:

```yaml
env:
  - name: HOST_IP
    valueFrom:
      fieldRef:
        fieldPath: status.hostIP
  - name: OTEL_EXPORTER_OTLP_ENDPOINT
    value: 'http://$(HOST_IP):4318'
  - name: OTEL_EXPORTER_OTLP_PROTOCOL
    value: 'http/protobuf'
  - name: OTEL_SERVICE_NAME
    value: '<SERVICE>'
  - name: OTEL_RESOURCE_ATTRIBUTES
    value: 'service.version=<VERSION>,deployment.environment.name=<ENV>'
```

Replace `<SERVICE>`, `<VERSION>`, and `<ENV>` with your service name, version, and environment. To send OTLP over gRPC instead, use port `4317` and set `OTEL_EXPORTER_OTLP_PROTOCOL` to `grpc`. Redeploy your application to apply the changes.

For how Datadog uses these tags, see [Unified service tagging](https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging.md).

## Verify the setup{% #verify-the-setup %}

If the Collector pods aren't running, see Troubleshooting.

After your application sends telemetry, check for it in Datadog. Data can take up to five minutes to appear. Replace `<SERVICE>`, `<ENV>`, and `<CLUSTER_NAME>` with the values from your configuration.

| Check                      | Where to look                                                                                                                                 | What you see                                                                                                                                                                                                                          |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Services                   | [Catalog](https://app.datadoghq.com/software): set the environment to `<ENV>` and search for `<SERVICE>`.                                     | The service page, with requests, errors, and latency.                                                                                                                                                                                 |
| Traces                     | [Trace Explorer](https://app.datadoghq.com/apm/traces): search for `service:<SERVICE> env:<ENV>`.                                             | Your service's traces.                                                                                                                                                                                                                |
| Hosts                      | [Host List](https://app.datadoghq.com/infrastructure)                                                                                         | Each node, as `<NODE_NAME>-<CLUSTER_NAME>`. With `DD_HOSTNAME` set as in the example configuration and no Datadog Agent on the node, each node appears one time.                                                                      |
| Metrics                    | [Metrics Explorer](https://app.datadoghq.com/metric/explorer): graph `avg:k8s.pod.cpu.usage{kube_cluster_name:<CLUSTER_NAME>}`.               | If you turned on kubelet metrics (the `kubelet_stats` receiver or the `kubeletMetrics` preset): pod CPU usage for your cluster.                                                                                                       |
| Logs from your application | [Log Explorer](https://app.datadoghq.com/logs): search for `service:<SERVICE> env:<ENV>`.                                                     | If your application sends logs over OTLP: your service's logs.                                                                                                                                                                        |
| Container logs             | [Log Explorer](https://app.datadoghq.com/logs): search for `kube_namespace:<NAMESPACE>`, where `<NAMESPACE>` is your application's namespace. | If you turned on container log collection (the `filelog` receiver or the `logsCollection` preset): the logs of the containers in that namespace. With the example configurations, these logs don't have the `service` and `env` tags. |

## Add the Datadog Agent (optional){% #install-the-core-datadog-agent-alongside-ddot %}

Some Datadog features need the Datadog Agent alongside the DDOT Collector. For which ones, see [Feature Compatibility](https://docs.datadoghq.com/opentelemetry/compatibility.md). To add the Datadog Agent, install it separately with the [Datadog Operator](https://docs.datadoghq.com/getting_started/containers/datadog_operator.md).

The DDOT Collector already collects some of the data the Datadog Agent can collect, and it uses host ports on every node. Before you deploy the Datadog Agent, check these settings in the `DatadogAgent` resource:

- **Container logs**: If the Collector collects container logs, as the example configurations do, leave container log collection off in the Datadog Agent. If both collect them, Datadog receives each container log twice, and you pay for both copies. To collect container logs with the Datadog Agent instead, remove the `filelog` receiver (OpenTelemetry Operator) or turn off the `logsCollection` preset (Helm).
- **OTLP ports**: Don't turn on the Datadog Agent's OTLP endpoint, or the Agent's Collector, on host ports `4317` or `4318`. The DDOT Collector uses those host ports on every node. Kubernetes can't schedule two pods that use the same host port on one node, so the Datadog Agent pod stays `Pending`.
- **Cluster name**: Set `spec.global.clusterName` to the same `<CLUSTER_NAME>` you use for the Collector. When a cluster name is set, the Datadog Agent reports `<NODE_NAME>-<CLUSTER_NAME>` as a host alias for the node. That's the same host name the Collector uses.

By default, the Datadog Operator Helm chart watches `DatadogAgent` resources only in the namespace where the Datadog Operator is installed (`watchNamespaces: []`). You can create the `DatadogAgent` resource in a different namespace, such as to keep it separate from the `OpenTelemetryCollector` resource. If you do, set `watchNamespaces` to list both namespaces. The list replaces the default, so include the Datadog Operator's own namespace:

```shell
helm upgrade datadog-operator datadog/datadog-operator \
  -n <DATADOG_OPERATOR_NAMESPACE> \
  --reuse-values \
  --set 'watchNamespaces={<DATADOG_OPERATOR_NAMESPACE>,<DATADOG_AGENT_NAMESPACE>}'
```

If the Datadog Operator doesn't watch the namespace where you create the `DatadogAgent` resource, it ignores the resource.

## Troubleshooting{% #troubleshooting %}

### The OpenTelemetry Operator install fails with `no matches for kind "Certificate"`{% #the-opentelemetry-operator-install-fails-with-no-matches-for-kind-certificate %}

Check that cert-manager and its custom resource definitions are installed. Then install the OpenTelemetry Operator again.

### `kubectl apply -f node-collector.yaml` fails with `failed calling webhook`{% #kubectl-apply--f-node-collectoryaml-fails-with-failed-calling-webhook %}

Check that the OpenTelemetry Operator is ready with `kubectl rollout status deployment/opentelemetry-operator --timeout=5m`, then apply the file again. If it still fails, check the OpenTelemetry Operator's webhook certificate and the network path to the webhook.

### The OpenTelemetry Collector pod shows `CreateContainerConfigError`{% #the-opentelemetry-collector-pod-shows-createcontainerconfigerror %}

This error usually means the OpenTelemetry Collector can't read its API key secret. Check that `datadog-secret` exists in the same namespace as the Collector, with the keys `api-key` and `site`:

```shell
kubectl describe secret datadog-secret
```

### The OpenTelemetry Collector pod exits with `unable to reliably determine the host name`{% #the-opentelemetry-collector-pod-exits-with-unable-to-reliably-determine-the-host-name %}

Check that `DD_HOSTNAME` is set, as described in Configure the Collector. The Collector exits with this error when it can't detect a hostname, such as on a node without cloud provider metadata.

### No data in Datadog{% #no-data-in-datadog %}

Search the Collector's logs for export errors. A `403` usually means the API key or the site is wrong. Replace `<DAEMONSET_NAME>` with `node-collector-collector` for the Operator, or `node-collector-opentelemetry-collector-agent` for Helm:

```shell
kubectl logs daemonset/<DAEMONSET_NAME> | grep -iE "403|forbidden|exporting failed"
```

## Uninstall{% #uninstall %}

Remove the Collector and the components you installed for it:

{% tab title="Operator" %}

{% alert level="warning" %}
Uninstalling the OpenTelemetry Operator also deletes its custom resource definitions. That removes every `OpenTelemetryCollector` and `Instrumentation` resource in the cluster, not only the ones from this guide. If other teams use the OpenTelemetry Operator in this cluster, check with them before you uninstall it.
{% /alert %}

Delete the `OpenTelemetryCollector` resource, then uninstall the OpenTelemetry Operator:

```shell
kubectl delete -f node-collector.yaml
helm uninstall opentelemetry-operator
kubectl delete secret opentelemetry-operator-controller-manager-service-cert
```

If you installed cert-manager for this guide and nothing else in your cluster uses it, uninstall it too. The cert-manager custom resource definitions and the `cert-manager` namespace remain. To remove them, see the [cert-manager uninstall guide](https://cert-manager.io/docs/installation/helm/#uninstalling).

```shell
helm uninstall cert-manager --namespace cert-manager
```

{% /tab %}

{% tab title="Helm" %}
Uninstall the Collector release:

```shell
helm uninstall node-collector
```

{% /tab %}

Then delete the API key secret:

```shell
kubectl delete secret datadog-secret
```

If you also installed the Datadog Agent, remove the `DatadogAgent` resource and the Datadog Operator separately.

## Next steps{% #next-steps %}

- **Instrument more applications**: [DDOT SDKs](https://docs.datadoghq.com/opentelemetry/instrument/ddot_sdks.md#enable-otlp-trace-export) or [upstream OpenTelemetry SDKs](https://docs.datadoghq.com/opentelemetry/instrument/upstream_otel_sdks.md).
- **Check host names and tags**: [Hostnames and Tagging](https://docs.datadoghq.com/opentelemetry/config/hostname_tagging.md).
- **Compare setups**: [Feature Compatibility](https://docs.datadoghq.com/opentelemetry/compatibility.md).

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

Additional helpful documentation, links, and articles:

- [OpenTelemetry Collector components included in DDOT](https://docs.datadoghq.com/opentelemetry/setup/ddot_collector.md#opentelemetry-collector-components)
