You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/opentelemetry/config/environment_variable_support.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,13 @@ Datadog SDKs implement the OpenTelemetry APIs for traces, metrics, and logs. Thi
33
33
34
34
This page describes the environment variables Datadog supports for OpenTelemetry interoperability.
35
35
36
-
<divclass="alert alert-info">If both Datadog and OpenTelemetry environment variables are set, Datadog takes precedence. Datadog defaults also override OpenTelemetry defaults. See the relevant <ahref="/tracing/trace_collection/library_config/">SDK Configuration page</a> for default values and more information.</div>
36
+
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`).
37
+
38
+
<divclass="alert alert-danger">
39
+
To avoid duplicate values appearing in Datadog for the same tag key, don't set both Datadog (<code>DD_*</code>) and OpenTelemetry (<code>OTEL_*</code>) environment variables for the same concept. Choose one convention.
40
+
<br>
41
+
See the relevant <ahref="/tracing/trace_collection/library_config/">SDK Configuration page</a> for default values and more information.
42
+
</div>
37
43
38
44
## Datadog SDK configuration
39
45
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][14].
@@ -47,10 +53,6 @@ These environment variables enable the Datadog SDK to ingest OpenTelemetry Metri
47
53
: **Description**: Enables the automatic instrumentation components of the Datadog SDK to collect and emit metrics generated by the OTel Metrics API. <br>
48
54
**Default**: `false`
49
55
50
-
`DD_LOGS_OTEL_ENABLED`
51
-
: **Description**: Enables the Datadog SDK's native OpenTelemetry Logs API implementation, allowing logs to be collected and exported in OTLP format. <br>
52
-
**Default**: `false`
53
-
54
56
`DD_LOGS_OTEL_ENABLED`
55
57
: **Description**: Enables the Datadog SDK to collect and export logs in the OTLP format. <br>
56
58
**Notes**: For most languages, this enables support for the OTel Logs API. For .NET, this enables interception of built-in loggers. <br>
@@ -62,7 +64,7 @@ Datadog SDKs support the following general OpenTelemetry SDK options. For more i
62
64
`OTEL_SERVICE_NAME`
63
65
: **Datadog convention**: `DD_SERVICE`<br>
64
66
Sets the `service.name` resource attribute<br>
65
-
**Notes**: This variable is one of several used to determine the final servicename. See the `service.name` notes under `OTEL_RESOURCE_ATTRIBUTES` for the complete precedence order.<br>
67
+
**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.<br>
66
68
67
69
`OTEL_LOG_LEVEL`
68
70
: **Datadog convention**: `DD_LOG_LEVEL`<br>
@@ -104,27 +106,32 @@ Trace exporter to be used<br>
104
106
105
107
`OTEL_RESOURCE_ATTRIBUTES`
106
108
: **Datadog convention**: `DD_TAGS` <br>
107
-
**Description**: Key-value pairs to be used as resource attributes. <br>
108
-
**Notes**: Datadog-defined configurations take precedence.
109
-
- `service.name` (maps to `DD_SERVICE`): Resolved with the following precedence: <br>
109
+
**Description**: Key-value pairs to be used as OpenTelemetry resource attributes. <br>
110
+
**Notes**: The SDK resolves overlapping settings using Datadog (`DD_*`) configuration first.
111
+
- `service.name` (maps to `DD_SERVICE`): The SDK resolves the value with the following precedence: <br>
110
112
1. Value of `DD_SERVICE` <br>
111
113
2. Value of `service` key in `DD_TAGS` <br>
112
114
3. Value of `OTEL_SERVICE_NAME` <br>
113
115
4. Value of `service.name` key in `OTEL_RESOURCE_ATTRIBUTES`
114
-
- `deployment.environment.name` (maps to `DD_ENV`): Resolved with the following precedence: <br>
116
+
- `deployment.environment.name` (maps to `DD_ENV`): The SDK resolves the value with the following precedence: <br>
115
117
1. Value of `DD_ENV` <br>
116
118
2. Value of `env` key in `DD_TAGS` <br>
117
119
3. Value of `deployment.environment.name` key in `OTEL_RESOURCE_ATTRIBUTES` <br>
118
120
4. Value of `deployment.environment` in `OTEL_RESOURCE_ATTRIBUTES`
119
-
- `service.version` (maps to `DD_VERSION`): Resolved with the following precedence: <br>
121
+
- `service.version` (maps to `DD_VERSION`): The SDK resolves the value with the following precedence: <br>
120
122
1. Value of `DD_VERSION` <br>
121
123
2. Value of `version` key in `DD_TAGS` <br>
122
124
3. Value of `service.version` key in `OTEL_RESOURCE_ATTRIBUTES`
123
125
- **Additional Attributes**: May be added through the `DD_TAGS` configuration, or `OTEL_RESOURCE_ATTRIBUTES` if `DD_TAGS` is not set.
124
126
127
+
<divclass="alert alert-danger">
128
+
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 <code>DD_ENV</code> and <code>OTEL_RESOURCE_ATTRIBUTES</code>) can result in multiple values appearing in Datadog (for example, <code>env:prod</code> and <code>env:dev</code>).
129
+
To avoid duplicates, configure each concept using only one convention.
130
+
</div>
131
+
125
132
`OTEL_SDK_DISABLED`
126
133
: **Description**: Disables the Datadog SDK's OpenTelemetry interoperability for all signals. <br>
127
-
**Notes**: **Notes**: When set to `true`, this effectively sets `DD_TRACE_OTEL_ENABLED=false`, `DD_LOGS_OTEL_ENABLED=false`, and `DD_METRICS_OTEL_ENABLED=false`.<br>
134
+
**Notes**: When set to `true`, this effectively sets `DD_TRACE_OTEL_ENABLED=false`, `DD_LOGS_OTEL_ENABLED=false`, and `DD_METRICS_OTEL_ENABLED=false`.<br>
128
135
**Ruby & Go SDKs**: The OpenTelemetry SDK activates automatically upon import and configuration, so this setting is not applicable.
129
136
130
137
## OTLP Exporter configuration
@@ -298,4 +305,4 @@ A comma-separated list of paths to extension jar files, or folders containing ja
0 commit comments