Skip to content

[DOCS-11944] Add Node.js examples and non-JSON log correlation for OTel traces#34432

Draft
brett0000FF wants to merge 1 commit intomasterfrom
brett.blue/DOCS-11944-nodejs-non-json-trace-correlation
Draft

[DOCS-11944] Add Node.js examples and non-JSON log correlation for OTel traces#34432
brett0000FF wants to merge 1 commit intomasterfrom
brett.blue/DOCS-11944-nodejs-non-json-trace-correlation

Conversation

@brett0000FF
Copy link
Contributor

@brett0000FF brett0000FF commented Feb 6, 2026

What does this PR do? What is the motivation?

Fixes DOCS-11944

Adds Node.js examples and non-JSON log format support to the OpenTelemetry trace-log correlation page:

  • New Node.js tab in the "Inject trace context into your logs" section, showing how to use @opentelemetry/instrumentation-winston for automatic trace context injection.
  • New "Non-JSON logs" sub-section under "Scrape logs from files", with a Node.js/Winston example for manual context injection into plain text logs and a corresponding filelog receiver config using regex_parser.

References

Merge instructions

Merge readiness:

  • Ready for merge

Additional notes

Based on customer feedback requesting guidance for Node.js apps with non-JSON log formats.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

…el traces

Add a Node.js tab to the trace context injection section showing
Winston auto-instrumentation, and add a new sub-section for
correlating non-JSON logs with a manual Winston formatter example
and regex_parser Collector config.
@brett0000FF brett0000FF force-pushed the brett.blue/DOCS-11944-nodejs-non-json-trace-correlation branch from 566a495 to 005e9e3 Compare February 6, 2026 20:28
@billmeyer
Copy link

It's slightly confusing while reading through the doc- of the 3 language choices: Go, Java, Node.js that are presented, when the reader scrolls down to the JSON logs example, the language shifts to Python for that one example and then back to Node.js for the Non-JSON logs. It would be good to stay consistent with the examples throughout.

Also, the Python examples looks suspect to me. When logging as JSON log lines, I would expect to simply use an add_fields method so that the log line is written as JSON and no additional, manual parsing is needed.

@brett0000FF
Copy link
Contributor Author

@billmeyer - Thanks for the review! Great points about the page overall.

The Python examples in the JSON logs and OTLP sections are pre-existing content, and this PR only added the Node.js tab at the top and the new Non-JSON logs subsection at the bottom.

The language inconsistency you're seeing was already there before this PR: Go/Java at the top, Python in the middle. My changes made it more noticeable by adding Node.js to the top tabs.

Looking at this more broadly, there's a bigger structural question here: OTel is treated as a "language" tab alongside Go, Java, Node.js, etc. on the parent page. This needs to be totally restructured with language first, then Datadog vs. OTel. That would eliminate the mixed-language examples problem entirely.

But that's a significant restructure, so I'll create another ticket to tackle that. 🫡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants