Configuring the Datadog Agent to Receive OTLP - gRPC and HTTP

To receive traces and metrics from the OpenTelemetry SDK with the Datadog Agent, open a gRPC 4317 or HTTP 4318 receiver in otlp_config. Logs are added with a separate key that is off by default, and applications point to the Agent on the same host.

A setup where the Agent on the same host receives the application's OTLP

There are several paths for bringing data from an application instrumented with the OpenTelemetry SDK into Datadog, and a comparison of which to choose is summarized in the explanation of OpenTelemetry support. What this article covers is one path: opening an OTLP receiver on a Datadog Agent that is already running, so that the Agent relays the traces, metrics, and logs arriving from the application to Datadog. The Agent can receive traces and metrics from 7.32.0 (6.32.0 for the 6 series) and logs from 7.48.0 (6.48.0 for the 6 series), over gRPC or HTTP. As a prerequisite, only setups that place a receiving Agent on each host that emits data are supported, and you cannot send to an Agent on a different host (as of October 2026; source: OTLP Ingestion by the Datadog Agent).

gRPC is 4317 and HTTP is 4318 - the receivers are closed by default

OTLP reception on the Agent is disabled by default. It opens when you write an endpoint for grpc or http under otlp_config.receiver.protocols in datadog.yaml, or pass the corresponding environment variable, and the default ports are 4317 for gRPC and 4318 for HTTP. The official procedure works with either one configured, and also includes a link to an example application that configures both. Once opened, reception of traces and metrics is enabled, and only logs remain closed (as of October 2026; source: OTLP Ingestion by the Datadog Agent).

otlp_config:
  receiver:
    protocols:
      grpc:
        endpoint: localhost:4317
      http:
        endpoint: localhost:4318
Where the keys that open the receivers go
LocationgRPC (4317)HTTP (4318)
datadog.yamlotlp_config.receiver.protocols.grpc.endpointotlp_config.receiver.protocols.http.endpoint
Environment variableDD_OTLP_CONFIG_RECEIVER_PROTOCOLS_GRPC_ENDPOINTDD_OTLP_CONFIG_RECEIVER_PROTOCOLS_HTTP_ENDPOINT
Helm datadog-values.yamldatadog.otlp.receiver.protocols.grpc.enabled: truedatadog.otlp.receiver.protocols.http.enabled: true
Datadog Operator DatadogAgentspec.features.otlp.receiver.protocols.grpc.enabled: truespec.features.otlp.receiver.protocols.http.enabled: true
Source: OTLP Ingestion by the Datadog Agent (the Host / Helm / Datadog Operator tabs)

The official configuration examples are written with 0.0.0.0, which means receiving from any network interface; because the official documentation warns you to consider localhost for local use, the example above uses localhost for hosts. Conversely, for an Agent in a container, specify 0.0.0.0 so it can be reached from outside. When passing environment variables, you must pass them to both the core Agent and the trace Agent processes; in a hand-written DaemonSet, write the same variables in both the trace-agent and agent containers.

Receiving logs requires two keys

Opening the receivers does not make OTLP logs arrive. They are disabled by default to avoid unexpected log charges, and you must explicitly enable two things: log collection for the Agent as a whole and reception of OTLP logs. In datadog.yaml, this is the pair logs_enabled: true and otlp_config.logs.enabled: true. If you pass them as environment variables, it is the pair DD_LOGS_ENABLED=true and DD_OTLP_CONFIG_LOGS_ENABLED=true (as of October 2026; source: OTLP Ingestion by the Datadog Agent).

The two keys for sending OTLP logs
How it runsAgent log collectionOTLP log reception
Host (datadog.yaml)logs_enabled: trueotlp_config.logs.enabled: true
Agent container on DockerDD_LOGS_ENABLED=trueDD_OTLP_CONFIG_LOGS_ENABLED=true
Helmdatadog.logs.enabled: truedatadog.otlp.logs.enabled: true
Datadog Operatorspec.features.logCollection.enabled: truePass DD_OTLP_CONFIG_LOGS_ENABLED as an override to the agent container of the Node Agent
Hand-written DaemonSetDD_LOGS_ENABLED in the core agent containerDD_OTLP_CONFIG_LOGS_ENABLED in the same container
Source: OTLP Ingestion by the Datadog Agent (the Enabling OTLP logs ingestion section)

Three things are closed by default: the OTLP receivers, Agent log collection, and OTLP log reception. When traces are visible but only logs are missing, first check which of the two keys is missing. Which environments to enable it in is easier to decide once you have looked at log volume and retention design in the explanation of Log Management.

How many resource attributes to copy into metric tags

OTLP metrics arrive after the Agent converts them into Datadog metrics. Which Datadog type each OTLP type becomes is covered by the official OTLP Metrics Types page, and the basics of the Datadog types are summarized in Metric Types. What matters in configuration is how tags are attached: by default, the Agent copies into tags only the resource attributes listed in the semantic conventions mapping table. If you want all other attributes to become tags too, set otlp_config.metrics.resource_attributes_as_tags to true (as of October 2026; source: OpenTelemetry Semantic Conventions and Datadog Conventions).

otlp_config:
  metrics:
    resource_attributes_as_tags: true
Examples of resource attributes copied into tags by default (excerpt from the mapping table)
OpenTelemetry resource attributeDatadog tagCategory
deployment.environment.nameenvUnified service tagging
service.nameserviceUnified service tagging
service.versionversionUnified service tagging
container.idcontainer_idContainer
cloud.regionregionCloud
Source: OpenTelemetry Semantic Conventions and Datadog Conventions

Copying everything comes at a cost: the official documentation cautions that tag cardinality can increase substantially and recommends checking the attached tags in Metrics Explorer. If you look at the number of resource attributes on a single metric and the variety of their values before enabling it, you can tell in advance whether the combinations of tags will balloon. On Kubernetes, the official documentation advises using a resource detector on the application side that adds container.id, so that container tags are attached to custom metrics.

For traces, the service and env names decide how they are grouped

What decides which service and which environment a span is grouped under on the APM screens is its resource attributes. The Agent copies the resource attributes service.name, deployment.environment.name, and service.version into service, env, and version of Unified Service Tagging. deployment.environment.name is the name that replaces the older deployment.environment, and it requires Agent 7.58.0 or later (as of October 2026; source: OpenTelemetry Semantic Conventions and Datadog Conventions). If you align the SDK side with the new name, check the version of the receiving Agent as well. span.type, which represents the kind of span, is inferred from the span's attributes in the following order of priority.

The order for determining span.type from an OpenTelemetry span
OrderSpan conditionDatadog span.type
1A span.type attribute existsThe value of that attribute
2The span kind is serverweb
3aThe kind is client and there is no db.system attributehttp
3bThe kind is client and there is a db.system attributeFollows the mapping table for each database type
4None of the above applycustom
Source: OpenTelemetry Semantic Conventions and Datadog Conventions (the Span type mapping section)

The approach to thinning out data also differs from the Datadog SDK. Because the official documentation states that data from applications instrumented with the OpenTelemetry SDK cannot be used with Ingestion Rules, think about sampling starting from the settings on the application's SDK side (source: OTLP Ingestion by the Datadog Agent). In the OpenTelemetry specification, the default value of OTEL_TRACES_SAMPLER is parentbased_always_on, so traces without a parent decision are all kept. To sample at a rate, choose parentbased_traceidratio and pass a probability from 0 to 1 in OTEL_TRACES_SAMPLER_ARG (source: Environment Variable Specification).

The application's destination is decided by a single OTEL_EXPORTER_OTLP_ENDPOINT

Even if the Agent's receivers are open, data does not arrive unless the application is pointed at them. The destination is set with the standard OpenTelemetry environment variable OTEL_EXPORTER_OTLP_ENDPOINT, where you write a URL on 4317 for gRPC or 4318 for HTTP. For HTTP, the official documentation cautions that, depending on the library, some expect the /v1/traces path as the trace destination while others expect the root / (as of October 2026; source: OTLP Ingestion by the Datadog Agent).

Where to point, by how it runs
How it runsWhat to do on the Agent sideThe application's OTEL_EXPORTER_OTLP_ENDPOINT
HostOpen the receivers in datadog.yamlhttp://localhost:4317 or http://localhost:4318
DockerPass the receiver environment variables to the Agent container and publish port 4317 or 4318http://<Agent container name>:4318 (place the two containers on the same bridge network)
KubernetesEnable the receivers with Helm or the Operator (for a hand-written DaemonSet, set containerPort and hostPort to 4317 or 4318)http://$(HOST_IP):4317 or :4318 (HOST_IP is taken from status.hostIP)
Source: OTLP Ingestion by the Datadog Agent (the Sending OpenTelemetry traces, metrics, and logs section)

The reason for using status.hostIP on Kubernetes is that the receiving Agent is that node's DaemonSet. On Docker, Compose automatically puts containers on the same bridge network; other arrangements are covered in Configuring the Agent with Docker, and how to distribute an Agent to each node is covered in Installing with Helm. If you set the same concept through two systems, such as DD_ENV and OTEL_RESOURCE_ATTRIBUTES, the Agent may collect both tags so that env:prod and env:dev appear side by side (source: OpenTelemetry Environment Variables Interoperability). For a single application, standardize on either the DD_ family or the OTEL_ family.

When receiving with the Agent pays off, and the order to follow when trying it

The reasons to route production ingestion through the Agent or the Collector, and the features that are unavailable for data instrumented with the OpenTelemetry SDK, are summarized in the explanation of OpenTelemetry; on a host where the Agent is already running, you can get onto that path without adding components.

Constraints to know before opening the receivers
ItemDetails
Agent placementPlace a receiving Agent on each host that emits data. You cannot send to an Agent on a different host
Source: OTLP Ingestion by the Datadog Agent

One service is enough when you try it. Prepare an Agent with the HTTP receiver open, pass OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_SERVICE_NAME to the application, and send a few requests. If that name appears in the APM service list and env and version are each attached with only the single intended value, the keys on the Agent and the application match. If it does not appear, check whether the Agent log contains Error running the OTLP ingest pipeline, and then suspect the port and path of the destination. Adding the two log keys after traces become visible makes it easier to isolate where things stopped.

References

Share