Skip to content

Conversation

@brett0000FF
Copy link
Contributor

Updated instructions for log collection with Datadog Agent to clarify trace ID injection and automatic detection of OpenTelemetry keys.

What does this PR do? What is the motivation?

  • Updated the Collect logs using the Datadog Agent section.
  • Removed the requirement to manually create a Log Processing Rule for standard trace_id fields.
  • Based on change to remapping config.

Merge instructions

Merge readiness:

  • Ready for merge

For Datadog employees:

Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). Without this format, your pull request will not pass CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.

If your branch doesn't follow this format, rename it or create a new branch and PR.

[6/5/2025] Merge queue has been disabled on the documentation repo. If you have write access to the repo, the PR has been reviewed by a Documentation team member, and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #documentation channel in Slack.

Additional notes

Updated instructions for log collection with Datadog Agent to clarify trace ID injection and automatic detection of OpenTelemetry keys.
@brett0000FF brett0000FF requested a review from a team as a code owner December 8, 2025 10:41
@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2025

Preview links (active after the build_preview check completes)

Modified Files

Comment on lines 213 to 215
- **Trace ID format**: Datadog automatically detects standard OpenTelemetry trace context keys (`trace_id` and `span_id`) in JSON logs. No manual configuration is required.
- If you are using **Datadog's tracing libraries** (like `dd-trace-py`), this is handled for you automatically.
- 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`.

- If you are defining custom attribute names for your trace IDs (not `trace_id` or `span_id`), you must use a [Log Processing Rule][5] to remap your custom attribute to dd.trace_id.
Copy link
Contributor

@jade-guiton-dd jade-guiton-dd Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few nitpicks:

  • Datadog's tracing libraries don't use the trace_id/span_id format, so the second sentence is a bit confusing
  • Plenty of OTel log bridges don't actually follow the OTel standard unfortunately, so problematic attribute names are not necessarily "custom"
  • (In the existing text) As I understand it, the Trace/Span ID Remapper rules don't rename attributes to DD conventions, they just set an internal field

So I would suggest wording like:

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.

If your logging instrumentation uses a different attribute name for your trace/span IDs, you must use a Trace/Span ID Remapper processing rule to make sure it is recognized.

It may also be good to add a link to this OTel docs page to justify that trace_id / span_id really is the standard.

Alternatively, instead of suggesting the Trace ID remapper, we could link to this docs page which explains how to configure log preprocessing to recognize the current attributes? It seems simpler than a remapper rule to me, but I'm not sure what the logs team would recommend between the two, they seem otherwise equivalent to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Very helpful. I adjusted the content further with your extra details.

I'll add someone from logs as a reviewer as well to confirm the trace ID remapper approach.

@brett0000FF brett0000FF added the Do Not Merge Just do not merge this PR :) label Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Do Not Merge Just do not merge this PR :)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants