";let n=document.getElementById("TableOfContents");n&&(n.innerHTML=e)}rerender(){this.rerenderFilterMenu(),this.rerenderPageContent(),this.populateRightNav(),this.runHooks("afterRerender")}rerenderPageContent(){let e={};Object.keys(this.ifFunctionsByRef).forEach(t=>{let s=this.ifFunctionsByRef[t],o=s.value,n=(0,h.reresolveFunctionNode)(s,{variables:this.selectedValsByTraitId});this.ifFunctionsByRef[t]=n,o!==n.value&&(e[t]=n.value)});let t=document.getElementsByClassName("cdoc__toggleable");for(let n=0;n{this.fitCustomizationMenuToScreen()})}addDropdownEventListeners(){let e=document.getElementsByClassName("cdoc-dropdown");for(let t=0;t{let t=e.target;for(;!t.classList.contains("cdoc-dropdown")&&t.parentElement;)t=t.parentElement;let n=t.classList.toggle("cdoc-dropdown__expanded");t.setAttribute("aria-expanded",n.toString())});document.addEventListener("keydown",e=>{if(e.key==="Enter"){let t=e.target;t.classList.contains("cdoc-filter__option")&&t.click()}}),document.addEventListener("click",t=>{for(let n=0;nthis.handleFilterSelectionChange(e));this.addDropdownEventListeners()}locateFilterSelectorEl(){let e=document.getElementById("cdoc-selector");return!!e&&(this.filterSelectorEl=e,!0)}applyFilterSelectionOverrides(){let s=Object.keys(this.selectedValsByTraitId),e=!1,t=this.browserStorage.getTraitVals();Object.keys(t).forEach(n=>{s.includes(n)&&this.selectedValsByTraitId[n]!==t[n]&&(this.selectedValsByTraitId[n]=t[n],e=!0)});let n=(0,j.getTraitValsFromUrl)({url:new URL(window.location.href),traitIds:s});return Object.keys(n).forEach(t=>{this.selectedValsByTraitId[t]!==n[t]&&(this.selectedValsByTraitId[t]=n[t],e=!0)}),e}updateEditButton(){let t=document.getElementsByClassName("toc-edit-btn")[0];if(!t)return;let e=t.getElementsByTagName("a")[0];e&&(e.href=e.href.replace(/\.md\/$/,".mdoc.md/"))}revealPage(){this.runHooks("beforeReveal"),this.filterSelectorEl&&(this.filterSelectorEl.style.position="sticky",this.filterSelectorEl.style.backgroundColor="white",this.filterSelectorEl.style.paddingTop="10px",this.filterSelectorEl.style.visibility="visible",this.filterSelectorEl.style.zIndex="1000");let e=document.getElementById("cdoc-content");e&&(e.style.visibility="visible"),this.runHooks("afterReveal")}rerenderFilterMenu(){if(!this.filterSelectorEl||!this.filtersManifest)throw new Error("Cannot rerender filter selector without filtersManifest and filterSelectorEl");let e=(0,l.resolveFilters)({filtersManifest:this.filtersManifest,valsByTraitId:this.selectedValsByTraitId});Object.keys(e).forEach(t=>{let n=e[t];this.selectedValsByTraitId[t]=n.currentValue});let t=(0,y.buildCustomizationMenuUi)(e);this.filterSelectorEl.innerHTML=t,this.fitCustomizationMenuToScreen(),this.addFilterSelectorEventListeners()}fitCustomizationMenuToScreen(){let e=document.getElementById(g);if(!e)return;let s=e.classList.contains(n),t=document.getElementById(v);if(!t)throw new Error("Dropdown menu not found");let o=document.getElementById(b);if(!o)throw new Error("Menu wrapper not found");let i=e.scrollWidth>o.clientWidth;!s&&i?(e.classList.add(n),t.classList.remove(n)):s&&!i&&(e.classList.remove(n),t.classList.add(n))}get cdocsState(){return{selectedValsByTraitId:this.selectedValsByTraitId,ifFunctionsByRef:this.ifFunctionsByRef,filtersManifest:this.filtersManifest,browserStorage:this.browserStorage,filterSelectorEl:this.filterSelectorEl}}};e.ClientFiltersManager=r,t=r,s={value:void 0}}),y=e(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=j();window.clientFiltersManager=t.ClientFiltersManager.instance}),y()})()Install the Datadog Distribution of OTel Collector
FedRAMP customers should not enable or use the embedded OpenTelemetry Collector.
Overview
Follow this guide to install the Datadog Distribution of OpenTelemetry (DDOT) Collector using Helm.
Need additional OpenTelemetry components? If you need components beyond those included in the default package, follow Use Custom OpenTelemetry Components to extend the Datadog Agent's capabilities. For a list of components included by default, see OpenTelemetry Collector components.
Install the Datadog Agent with OpenTelemetry Collector
Select installation method
Choose one of the following installation methods:
Datadog Operator: A Kubernetes-native approach that automatically reconciles and maintains your Datadog setup. It reports deployment status, health, and errors in its Custom Resource status, and it limits the risk of misconfiguration thanks to higher-level configuration options.
Helm chart: A straightforward way to deploy Datadog Agent. It provides versioning, rollback, and templating capabilities, making deployments consistent and easier to replicate.
Replace <DD_API_KEY> and <DD_APP_KEY> with your actual Datadog API and application keys.
Configure the Datadog Agent
After deploying the Datadog Operator, create the DatadogAgent resource that triggers the deployment of the Datadog Agent, Cluster Agent and Cluster Checks Runners (if used) in your Kubernetes cluster. The Datadog Agent deploys as a DaemonSet, running a pod on every node of your cluster.
Use the datadog-agent.yaml file to specify your DatadogAgent deployment configuration.
By default, the Agent image is pulled from Google Artifact Registry (gcr.io/datadoghq). If Artifact Registry is not accessible in your deployment region, use another registry.
When enabling additional Datadog features, always use the Datadog or OpenTelemetry Collector configuration files instead of relying on Datadog environment variables.
Use a YAML file to specify the Helm chart parameters for the Datadog Agent chart.
Create an empty datadog-values.yaml file:
touch datadog-values.yaml
Unspecified parameters use defaults from values.yaml.
Configure the Datadog API and application key secrets:
By default, the Agent image is pulled from Google Artifact Registry (gcr.io/datadoghq). If Artifact Registry is not accessible in your deployment region, use another registry.
Enable the OpenTelemetry Collector and configure the essential ports:
datadog-values.yaml
datadog:...otelCollector:enabled:trueports:- containerPort:"4317"# default port for OpenTelemetry gRPC receiver.hostPort:"4317"name:otel-grpc- containerPort:"4318"# default port for OpenTelemetry HTTP receiverhostPort:"4318"name:otel-http
Set the hostPort to expose the container port to the external network. This enables configuring the OTLP exporter to point to the IP address of the node where the Datadog Agent is assigned.
If you don’t want to expose the port, you can use the Agent service instead:
Remove the hostPort entries from your datadog-values.yaml file.
In your application’s deployment file (deployment.yaml), configure the OTLP exporter to use the Agent service:
When enabling additional Datadog features, always use the Datadog or OpenTelemetry Collector configuration files instead of relying on Datadog environment variables.
(Optional) Collect pod labels and use them as tags to attach to metrics, traces, and logs:
The Datadog Operator provides a sample OpenTelemetry Collector configuration that you can use as a starting point. If you need to modify this configuration, the Datadog Operator supports two ways of providing a custom Collector configuration:
Inline configuration: Add your custom Collector configuration directly in the features.otelCollector.conf.configData field.
ConfigMap-based configuration: Store your Collector configuration in a ConfigMap and reference it in the features.otelCollector.conf.configMap field. This approach allows you to keep Collector configuration decoupled from the DatadogAgent resource.
Inline Collector configuration
In the snippet below, the Collector configuration is placed directly under the features.otelCollector.conf.configData parameter:
When you apply the datadog-agent.yaml file containing this DatadogAgent resource, the Operator automatically mounts the Collector configuration into the Agent DaemonSet.
Completed datadog-agent.yaml file with inlined Collector config
Completed datadog-agent.yaml with inline Collector configuration should look something like this:
The Datadog Helm chart provides a sample OpenTelemetry Collector configuration that you can use as a starting point. This section walks you through the predefined pipelines and included OpenTelemetry components.
This is the full OpenTelemetry Collector configuration in otel-config.yaml:
Note: If key is not specified or set to a secret, or if site is not specified, the system uses values from the core Agent configuration. By default, the core Agent sets site to datadoghq.com (US1).
Prometheus receiver
The Prometheus receiver collects health metrics from the OpenTelemetry Collector for the metrics pipeline.
Deploy the Datadog Agent with the configuration file:
kubectl apply -f datadog-agent.yaml
This deploys the Datadog Agent as a DaemonSet with the DDOT OpenTelemetry Collector. The Collector runs on the same host as your application, following the Agent deployment pattern. The Gateway deployment pattern is not supported.
To install or upgrade the Datadog Agent with OpenTelemetry Collector in your Kubernetes environment, use one of the following Helm commands:
For default OpenTelemetry Collector configuration:
This command allows you to specify your own otel-config.yaml file.
Replace <RELEASE_NAME> with the Helm release name you are using.
You may see warnings during the deployment process. These warnings can be ignored.
This Helm chart deploys the Datadog Agent with OpenTelemetry Collector as a DaemonSet. The Collector is deployed on the same host as your application, following the Agent deployment pattern. The Gateway deployment pattern is not supported.
Example application instrumented with the OpenTelemetry API
As an example, you can use the Calendar sample application that’s already instrumented for you. The following code instruments the CalendarService.getDate() method using the OpenTelemetry annotations and API:
Your application container must send data to the DDOT Collector on the same host. Since the Collector runs as a DaemonSet, you need to specify the local host as the OTLP endpoint.
If the OTEL_EXPORTER_OTLP_ENDPOINT environment variable is not already set, add it to your application’s Deployment manifest file:
Unified service tagging ties observability data together in Datadog so you can navigate across metrics, traces, and logs with consistent tags.
Unified service tagging ties observability data together in Datadog so you can navigate across metrics, traces, and logs with consistent tags.
In containerized environments, env, service, and version are set through the OpenTelemetry Resource Attributes environment variables or Kubernetes labels on your deployments and pods. The DDOT detects this tagging configuration and applies it to the data it collects from containers.
To get the full range of unified service tagging, add both the environment variables and the deployment/pod labels:
Redeploy your application to apply the changes made in the deployment manifest. Once the updated configuration is active, Unified Service Tagging will be fully enabled for your metrics, traces, and logs.
Explore observability data in Datadog
Use Datadog to explore the observability data for your application.
Fleet automation
Explore your Datadog Agent and Collector configuration.
Live container monitoring
Monitor your container health using Live Container Monitoring capabilities.
Infrastructure node health
View runtime and infrastructure metrics to visualize, monitor, and measure the performance of your nodes.
Logs
View logs to monitor and troubleshoot application and system operations.
Traces
View traces and spans to observe the status and performance of requests processed by your application, with infrastructure metrics correlated in the same trace.
Runtime metrics
Monitor your runtime (JVM) metrics for your applications.
Collector health metrics
View metrics from the DDOT Collector to monitor the Collector health.
Further reading
Additional helpful documentation, links, and articles: