---
title: OpenTelemetry Environment Variables Interoperability
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > OpenTelemetry in Datadog > OpenTelemetry Configuration > OpenTelemetry
  Environment Variables Interoperability
---

# OpenTelemetry Environment Variables Interoperability

Datadog SDKs implement the OpenTelemetry APIs for traces, metrics, and logs. This allows you to use standard OpenTelemetry environment variables to configure your application while receiving additional Datadog telemetry with minimal changes to your existing configuration.

This page describes the environment variables Datadog supports for OpenTelemetry interoperability.

The precedence rules on this page describe how *Datadog SDKs* resolve configuration into OpenTelemetry resource attributes (for example, `service.name`, `deployment.environment.name`, `service.version`).

{% alert level="danger" %}
To avoid duplicate values appearing in Datadog for the same tag key, don't set both Datadog (`DD_*`) and OpenTelemetry (`OTEL_*`) environment variables for the same concept. Choose one convention.See the relevant [SDK Configuration page](https://docs.datadoghq.com/tracing/trace_collection/library_config/) for default values and more information.
{% /alert %}

## Network requirements{% #network-requirements %}

When using the Datadog SDK with OpenTelemetry API support, telemetry is routed to different components depending on the signal source. Ensure the following ports are accessible on your Datadog Agent or Collector:

| Signal Source             | Protocol             | Port        | Destination Component                         |
| ------------------------- | -------------------- | ----------- | --------------------------------------------- |
| OTel Metrics and Logs API | OTLP (gRPC/HTTP)     | 4317 / 4318 | Datadog Agent OTLP Receiver or DDOT Collector |
| Datadog Tracing           | Datadog trace intake | 8126 (TCP)  | Datadog Trace Agent                           |
| Runtime Metrics           | DogStatsD            | 8125 (UDP)  | DogStatsD Server                              |

**Note**: Even when `DD_METRICS_OTEL_ENABLED=true`, standard Runtime Metrics are still emitted through DogStatsD.

## Datadog SDK configuration{% #datadog-sdk-configuration %}

These environment variables enable the Datadog SDK to ingest OpenTelemetry Metrics and Logs API data. For guides on how to instrument your application, see the [language-specific instrumentation documentation](https://docs.datadoghq.com/opentelemetry/instrument/api_support/).

{% dl %}

{% dt %}
`DD_TRACE_OTEL_ENABLED`
{% /dt %}

{% dd %}
**Description**: Enables the Datadog SDK's OpenTelemetry interoperability for traces.**Default**: `false`**Notes**: The default is `true` in the Java SDK.
{% /dd %}

{% dt %}
`DD_METRICS_OTEL_ENABLED`
{% /dt %}

{% dd %}
**Description**: Enables the automatic instrumentation components of the Datadog SDK to collect and emit metrics generated by the OTel Metrics API.**Default**: `false`
{% /dd %}

{% dt %}
`DD_LOGS_OTEL_ENABLED`
{% /dt %}

{% dd %}
**Description**: Enables the Datadog SDK to collect and export logs in the OTLP format.**Notes**: For most languages, this enables support for the OTel Logs API. For .NET, this enables interception of built-in loggers.**Default**: `false`
{% /dd %}

{% /dl %}

## General SDK configuration{% #general-sdk-configuration %}

Datadog SDKs support the following general OpenTelemetry SDK options. For more information, see the related [OpenTelemetry documentation](https://opentelemetry.io/docs/specs/otel/configuration/SDK-environment-variables/#general-SDK-configuration).

{% dl %}

{% dt %}
`OTEL_SERVICE_NAME`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_SERVICE`Sets the `service.name` resource attribute**Notes**: When determining the final `service.name` resource attribute, the SDK uses this variable as an input to determine the final `service.name`. See the `service.name` notes under `OTEL_RESOURCE_ATTRIBUTES` for the complete precedence order.
{% /dd %}

{% dt %}
`OTEL_LOG_LEVEL`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_LOG_LEVEL`Log level used by the SDK logger**Notes**: A log level of debug also maps to `DD_TRACE_DEBUG=true`In the Node.js & PHP SDKs this maps to `DD_TRACE_LOG_LEVEL`In the Go SDK only mapped values between `OTEL_LOG_LEVEL` & `DD_TRACE_DEBUG` are supported:
- `info`|`false`
- `debug`|`true`**Not Supported In**: Python, .NET, Ruby, and Go SDKs

{% /dd %}

{% dt %}
`OTEL_PROPAGATORS`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_TRACE_PROPAGATION_STYLE`Propagators to be used as a comma-separated list**Notes**: The only supported values for most Datadog SDKs are `tracecontext`, `b3`, `b3multi`, `none`, `datadog`. `xray` is also supported for the Java SDKValues must be deduplicated to register a `Propagator` only once
{% /dd %}

{% dt %}
`OTEL_TRACES_SAMPLER & OTEL_TRACES_SAMPLER_ARG`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_TRACE_SAMPLE_RATE``OTEL_TRACES_SAMPLER`: Sampler to be used for traces & `OTEL_TRACES_SAMPLER_ARG`: String value to be used as the sampler argument**Notes**: The specified value is only used if `OTEL_TRACES_SAMPLER` is set. Each Sampler type defines its own expected input, if any. Invalid or unrecognized input MUST be logged and MUST be otherwise ignored. In such cases, the implementation MUST behave as if `OTEL_TRACES_SAMPLER_ARG` is not setMapped values between `OTEL_TRACES_SAMPLER` & `DD_TRACE_SAMPLE_RATE`:
- `parentbased_always_on`|`1.0`
- `parentbased_always_off`|`0.0`
- `parentbased_traceidratio`|`${OTEL_TRACES_SAMPLER_ARG}`
- `always_on`|`1.0`
- `always_off`|`0.0`
- `traceidratio`|`${OTEL_TRACES_SAMPLER_ARG}`

{% /dd %}

{% dt %}
`OTEL_TRACES_EXPORTER`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_TRACE_ENABLED=false`Trace exporter to be used**Notes**: Only a value of `none` is accepted
{% /dd %}

{% dt %}
`OTEL_METRICS_EXPORTER`
{% /dt %}

{% dd %}
**Description**: Specifies the metrics exporter to be used.**Notes**: The only accepted values are `otlp` and `none`. A value of `none` disables the emission of OTel metrics, as well as APM runtime metrics (equivalent to `DD_RUNTIME_METRICS_ENABLED=false`)**Default**: `otlp`
{% /dd %}

{% dt %}
`OTEL_RESOURCE_ATTRIBUTES`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_TAGS`**Description**: Key-value pairs to be used as OpenTelemetry resource attributes.**Notes**: The SDK resolves overlapping settings using Datadog (`DD_*`) configuration first.
- `service.name` (maps to `DD_SERVICE`): The SDK resolves the value with the following precedence:
  1. Value of `DD_SERVICE`
  1. Value of `service` key in `DD_TAGS`
  1. Value of `OTEL_SERVICE_NAME`
  1. Value of `service.name` key in `OTEL_RESOURCE_ATTRIBUTES`
- `deployment.environment.name` (maps to `DD_ENV`): The SDK resolves the value with the following precedence:
  1. Value of `DD_ENV`
  1. Value of `env` key in `DD_TAGS`
  1. Value of `deployment.environment.name` key in `OTEL_RESOURCE_ATTRIBUTES`
  1. Value of `deployment.environment` in `OTEL_RESOURCE_ATTRIBUTES`
- `service.version` (maps to `DD_VERSION`): The SDK resolves the value with the following precedence:
  1. Value of `DD_VERSION`
  1. Value of `version` key in `DD_TAGS`
  1. Value of `service.version` key in `OTEL_RESOURCE_ATTRIBUTES`
- **Additional Attributes**: May be added through the `DD_TAGS` configuration, or `OTEL_RESOURCE_ATTRIBUTES` if `DD_TAGS` is not set.

{% alert level="danger" %}
Although the SDK resolves these settings internally for emitted telemetry, the Datadog Agent collects tags from all configured sources without overriding. Configuring service/environment/version using multiple inputs (for example, both `DD_ENV` and `OTEL_RESOURCE_ATTRIBUTES`) can result in multiple values appearing in Datadog (for example, `env:prod` and `env:dev`). To avoid duplicates, configure each concept using only one convention.
{% /alert %}

{% /dd %}

{% dt %}
`OTEL_SDK_DISABLED`
{% /dt %}

{% dd %}
**Description**: Disables the Datadog SDK's OpenTelemetry interoperability for all signals.**Notes**: When set to `true`, this effectively sets `DD_TRACE_OTEL_ENABLED=false`, `DD_LOGS_OTEL_ENABLED=false`, and `DD_METRICS_OTEL_ENABLED=false`.**Ruby & Go SDKs**: The OpenTelemetry SDK activates automatically upon import and configuration, so this setting is not applicable.
{% /dd %}

{% /dl %}

## OTLP Exporter configuration{% #otlp-exporter-configuration %}

Datadog SDKs support the following [OpenTelemetry OTLP Exporter](https://opentelemetry.io/docs/specs/otel/protocol/exporter/) options.

Signal-specific variables (like `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`) always take precedence over their general counterparts (like `OTEL_EXPORTER_OTLP_PROTOCOL`).

### General OTLP configuration{% #general-otlp-configuration %}

{% dl %}

{% dt %}
`OTEL_EXPORTER_OTLP_PROTOCOL`
{% /dt %}

{% dd %}
**Description**: Specifies the transport protocol to use for all signals unless overridden.**Accepted values**: `grpc`, `http/protobuf`, `http/json`.**Default**: SDK-dependent. The Datadog SDK aims to match the default protocol of the corresponding official OpenTelemetry SDK for that language.
{% /dd %}

{% dt %}
`OTEL_EXPORTER_OTLP_ENDPOINT`
{% /dt %}

{% dd %}
**Description**: Specifies the base URL for sending OTLP data for all signals unless overridden.**Default (gRPC)**: `http://localhost:4317`.**Default (HTTP)**: `http://localhost:4318`.
{% /dd %}

{% dt %}
`OTEL_EXPORTER_OTLP_HEADERS`
{% /dt %}

{% dd %}
**Description**: Specifies a comma-separated list of key-value pairs to be used as headers on all outgoing OTLP requests (for example, `api-key=key,other-config=value`).
{% /dd %}

{% dt %}
`OTEL_EXPORTER_OTLP_TIMEOUT`
{% /dt %}

{% dd %}
**Description**: Specifies the timeout (in milliseconds) for all outgoing OTLP requests unless overridden.**Default**: `10000` (10s).
{% /dd %}

{% /dl %}

### Metrics-specific OTLP configuration{% #metrics-specific-otlp-configuration %}

For more details on the official specification for these variables, see the [OpenTelemetry OTLP Metrics Exporter documentation](https://opentelemetry.io/docs/specs/otel/metrics/sdk_exporters/otlp/#additional-environment-variable-configuration).

{% dl %}

{% dt %}
`OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`
{% /dt %}

{% dd %}
**Description**: Specifies the OTLP transport protocol to use for metrics data. Takes precedence over the general `OTEL_EXPORTER_OTLP_PROTOCOL`.**Accepted values**: `grpc`, `http/protobuf`, `http/json`.**Default**: SDK-dependent. The Datadog SDK aims to match the default protocol of the corresponding official OpenTelemetry SDK for that language.
{% /dd %}

{% dt %}
`OTEL_EXPORTER_OTLP_METRICS_ENDPOINT`
{% /dt %}

{% dd %}
**Description**: Specifies the URL for sending OTLP metrics data. Takes precedence over the general `OTEL_EXPORTER_OTLP_ENDPOINT`.**Default (gRPC)**: `http://localhost:4317`.**Default (HTTP)**: `http://localhost:4318/v1/metrics`.**Notes**: For HTTP protocols, the SDK will automatically append `/v1/metrics` if the general `OTEL_EXPORTER_OTLP_ENDPOINT` is used as a fallback.
{% /dd %}

{% dt %}
`OTEL_EXPORTER_OTLP_METRICS_HEADERS`
{% /dt %}

{% dd %}
**Description**: Specifies a comma-separated list of key-value pairs to be used as headers on outgoing OTLP metrics requests (for example, `api-key=key,other-config=value`). Takes precedence over the general `OTEL_EXPORTER_OTLP_HEADERS`.
{% /dd %}

{% dt %}
`OTEL_EXPORTER_OTLP_METRICS_TIMEOUT`
{% /dt %}

{% dd %}
**Description**: Specifies the timeout (in milliseconds) for a single outgoing OTLP metrics request. Takes precedence over the general `OTEL_EXPORTER_OTLP_TIMEOUT`.**Default**: `10000` (10s).
{% /dd %}

{% /dl %}

### Logs-specific OTLP configuration{% #logs-specific-otlp-configuration %}

{% dl %}

{% dt %}
`OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`
{% /dt %}

{% dd %}
**Description**: Specifies the OTLP transport protocol for logs. Takes precedence over `OTEL_EXPORTER_OTLP_PROTOCOL`.
{% /dd %}

{% dd %}
**Accepted values**: `grpc`, `http/protobuf`, `http/json`
{% /dd %}

{% dd %}
**Default**: SDK-dependent. The Datadog SDK aims to match the default protocol of the corresponding official OpenTelemetry SDK for that language.
{% /dd %}

{% dt %}
`OTEL_EXPORTER_OTLP_LOGS_ENDPOINT`
{% /dt %}

{% dd %}
**Description**: Specifies the URL for sending OTLP logs. Takes precedence over `OTEL_EXPORTER_OTLP_ENDPOINT`.
{% /dd %}

{% dd %}
**Default (gRPC)**: `http://localhost:4317`
{% /dd %}

{% dd %}
**Default (HTTP)**: `http://localhost:4318/v1/logs`
{% /dd %}

{% dt %}
`OTEL_EXPORTER_OTLP_LOGS_HEADERS`
{% /dt %}

{% dd %}
**Description**: Specifies a comma-separated list of key-value pairs to be used as headers on outgoing OTLP logs requests. Takes precedence over the general `OTEL_EXPORTER_OTLP_HEADERS`.
{% /dd %}

{% dt %}
`OTEL_EXPORTER_OTLP_LOGS_TIMEOUT`
{% /dt %}

{% dd %}
**Description**: Specifies the timeout (in milliseconds) for a single outgoing OTLP logs request. Takes precedence over the general `OTEL_EXPORTER_OTLP_TIMEOUT`.**Default**: `10000` (10s).
{% /dd %}

{% /dl %}

## OpenTelemetry Metrics SDK configuration{% #opentelemetry-metrics-sdk-configuration %}

Datadog SDKs support the following OpenTelemetry Metrics SDK options.

{% dl %}

{% dt %}
`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE`
{% /dt %}

{% dd %}
**Description**: Specifies the aggregation `temporality` to use for each instrument kind.**Accepted values**: `Cumulative`, `Delta`, `LowMemory`. For more details, see the [OpenTelemetry specification](https://opentelemetry.io/docs/specs/otel/metrics/sdk_exporters/otlp/#additional-environment-variable-configuration).**Default**: `delta`**Notes**: This default value `delta` is [Datadog's recommended configuration](https://docs.datadoghq.com/opentelemetry/guide/otlp_delta_temporality/) and differs from the OpenTelemetry specification's default.
{% /dd %}

{% dt %}
`OTEL_METRIC_EXPORT_INTERVAL`
{% /dt %}

{% dd %}
**Description**: Specifies the time interval (in milliseconds) between metric export attempts.**Default**: `10000` (10s)**Notes**: This default value is Datadog's recommended configuration and differs from the OpenTelemetry specification's default of 60000ms.
{% /dd %}

{% dt %}
`OTEL_METRIC_EXPORT_TIMEOUT`
{% /dt %}

{% dd %}
**Description**: Specifies the maximum allowed time (in milliseconds) to collect and export metrics.**Default**: `7500` (7.5s)**Notes**: This default value is Datadog's recommended configuration and differs from the OpenTelemetry specification's default of 30000ms.
{% /dd %}

{% /dl %}

## OpenTelemetry Logs SDK configuration{% #opentelemetry-logs-sdk-configuration %}

Datadog SDKs support the following OpenTelemetry Logs SDK options.

{% dl %}

{% dt %}
`OTEL_LOGS_EXPORTER`
{% /dt %}

{% dd %}
**Description**: Specifies the logs exporter to be used.**Accepted values**: `otlp`, `none`. A value of `none` disables the emission of OTel logs.**Default**: `otlp`
{% /dd %}

{% dt %}
`OTEL_BLRP_MAX_QUEUE_SIZE`
{% /dt %}

{% dd %}
**Description**: The maximum number of log records to hold in memory. New records are dropped when the limit is reached.**Default**: `2048`
{% /dd %}

{% dt %}
`OTEL_BLRP_SCHEDULE_DELAY`
{% /dt %}

{% dd %}
**Description**: The time interval (in milliseconds) between two consecutive export operations.**Default**: `1000` (1s)
{% /dd %}

{% dt %}
`OTEL_BLRP_EXPORT_TIMEOUT`
{% /dt %}

{% dd %}
**Description**: The maximum duration (in milliseconds) allowed for a single export before cancellation.**Default**: `30000` (30s)
{% /dd %}

{% dt %}
`OTEL_BLRP_MAX_EXPORT_BATCH_SIZE`
{% /dt %}

{% dd %}
**Description**: The maximum number of log records in a single OTLP payload.**Default**: `512`
{% /dd %}

{% /dl %}

## Java-specific configuration{% #java-specific-configuration %}

Datadog SDKs support the following Java-specific OpenTelemetry configuration options. For more information, see the [OpenTelemetry documentation on Java agent configuration](https://opentelemetry.io/docs/zero-code/java/agent/configuration/#configuring-the-agent).

{% dl %}

{% dt %}
`OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED`
{% /dt %}

{% dd %}
**Datadog convention**: `!DD_INTEGRATIONS_ENABLED`Set to `false` to disable all instrumentation in the Agent**Notes**: Mapped values between `OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED` & `DD_INTEGRATIONS_ENABLED`:
- `true`|`false`
- `false`|`true`

{% /dd %}

{% dt %}
`OTEL_INSTRUMENTATION_[NAME]_ENABLED`
{% /dt %}

{% dd %}
**Description**: Enables/disables the named OTel drop-in instrumentation
{% /dd %}

{% dt %}
`OTEL_JAVAAGENT_CONFIGURATION_FILE`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_TRACE_CONFIG`Path to valid Java properties file which contains the agent configuration**Notes**: When OTEL_JAVAAGENT_CONFIGURATION_FILE and DD_TRACE_CONFIG are both set we apply the configuration from both files. This is an exception to the usual rule where the Datadog setting overrides the OTel one
{% /dd %}

{% dt %}
`OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_REQUEST_HEADERS`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_TRACE_REQUEST_HEADER_TAGS`A comma-separated list of HTTP header names. HTTP client instrumentations capture HTTP request header values for all configured header names**Notes**: Header tagging configured using OTel environment variables follows the OTel tag name convention of `http.request.header.<header-name>` rather than the Datadog convention of `http.request.headers.<header-name>`
{% /dd %}

{% dt %}
`OTEL_INSTRUMENTATION_HTTP_CLIENT_CAPTURE_RESPONSE_HEADERS`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_TRACE_RESPONSE_HEADER_TAGS`A comma-separated list of HTTP header names. HTTP client instrumentations capture HTTP response header values for all configured header names**Notes**: Header tagging configured using OTel environment variables follows the OTel tag name convention of `http.response.header.<header-name>` rather than the Datadog convention of `http.response.headers.<header-name>`
{% /dd %}

{% dt %}
`OTEL_INSTRUMENTATION_HTTP_SERVER_CAPTURE_REQUEST_HEADERS`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_TRACE_REQUEST_HEADER_TAGS`A comma-separated list of HTTP header names. HTTP server instrumentations capture HTTP request header values for all configured header names**Notes**: Header tagging configured using OTel environment variables follows the OTel tag name convention of `http.request.header.<header-name>` rather than the Datadog convention of `http.request.headers.<header-name>`
{% /dd %}

{% dt %}
`OTEL_INSTRUMENTATION_HTTP_SERVER_CAPTURE_RESPONSE_HEADERS`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_TRACE_RESPONSE_HEADER_TAGS`A comma-separated list of HTTP header names. HTTP server instrumentations capture HTTP response header values for all configured header names**Notes**: Header tagging configured using OTel environment variables follows the OTel tag name convention of `http.response.header.<header-name>` rather than the Datadog convention of `http.response.headers.<header-name>`
{% /dd %}

{% dt %}
`OTEL_JAVAAGENT_EXTENSIONS`
{% /dt %}

{% dd %}
**Datadog convention**: `DD_TRACE_EXTENSIONS_PATH`A comma-separated list of paths to extension jar files, or folders containing jar files. If pointing to a folder, every jar file in that folder is treated as a separate, independent extension.
{% /dd %}

{% /dl %}

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

- [.NET Core SDK Configuration](https://docs.datadoghq.com/tracing/trace_collection/library_config/dotnet-core)
- [.NET Framework SDK Configuration](https://docs.datadoghq.com/tracing/trace_collection/library_config/dotnet-framework)
- [Go SDK Configuration](https://docs.datadoghq.com/tracing/trace_collection/library_config/go)
- [Java SDK Configuration](https://docs.datadoghq.com/tracing/trace_collection/library_config/java)
- [Node.js SDK Configuration](https://docs.datadoghq.com/tracing/trace_collection/library_config/nodejs)
- [PHP SDK Configuration](https://docs.datadoghq.com/tracing/trace_collection/library_config/php)
- [Python SDK Configuration](https://docs.datadoghq.com/tracing/trace_collection/library_config/python)
- [Ruby SDK Configuration](https://docs.datadoghq.com/tracing/trace_collection/library_config/ruby)
