Skip to content

Commit e250667

Browse files
authored
Clarify log collection instructions for Datadog Agent (#33203)
* Clarify log collection instructions for Datadog Agent Updated instructions for log collection with Datadog Agent to clarify trace ID injection and automatic detection of OpenTelemetry keys. * Clarify trace ID requirements for Datadog Agent
1 parent 1ef8746 commit e250667

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

content/en/tracing/other_telemetry/connect_logs_and_traces/opentelemetry.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@ This manual approach gives you full control over the log format, ensuring it is
208208

209209
#### Collect logs using the Datadog Agent
210210

211-
If you collect logs directly with the Datadog Agent (without sending them through the OpenTelemetry Collector), you must ensure the trace IDs in your logs use the Datadog format.
211+
If you collect logs directly with the Datadog Agent (without sending them through the OpenTelemetry Collector), you must ensure the trace IDs are present in your logs.
212212

213-
- **Trace ID format**: The Datadog Agent requires the trace ID to be in the `dd.trace_id` field.
214-
- If you are using **Datadog's tracing libraries** (like `dd-trace-py`), this is handled for you automatically.
215-
- If you are generating logs with OpenTelemetry `trace_id` and `span_id` (as shown in the [file-scraping example](#scrape-logs-from-files)), you must use a [Log Processing Rule][5] in Datadog to remap your `trace_id` attribute to `dd.trace_id`.
213+
- **Trace ID format**: Datadog automatically detects the `dd.trace_id` and `dd.span_id` convention used by Datadog's tracing libraries, as well as the OpenTelemetry standards `trace_id` and `span_id`. See [OpenTelemetry Compatibility docs][6] for details on the standard.
214+
215+
<div class="alert alert-info">If your logging instrumentation uses a different attribute name for your trace/span IDs, you must ensure the attribute is added to the <a href="/logs/log_configuration/pipelines/?tab=traceid#preprocessing">Preprocessing for JSON logs</a> configuration so it is recognized as a valid Trace ID.</div>
216216

217217
- **Attribute Mapping**: The Datadog Agent does not automatically convert OTel resource attributes (for example, `service.name`) to Datadog's standard tags. You may need to manually remap these attributes in your log processing pipeline to maintain unified service tagging.
218218

@@ -247,4 +247,5 @@ Click **View Trace in APM** to pivot directly to the full APM trace associated w
247247
[2]: https://github.com/DataDog/opentelemetry-examples
248248
[3]: https://app.datadoghq.com/apm/traces
249249
[4]: https://app.datadoghq.com/logs
250-
[5]: /logs/log_configuration/processors
250+
[5]: /logs/log_configuration/processors
251+
[6]: https://opentelemetry.io/docs/specs/otel/compatibility/logging_trace_context/

0 commit comments

Comments
 (0)