[DOCS-11944] Add Node.js examples and non-JSON log correlation for OTel traces#34432
[DOCS-11944] Add Node.js examples and non-JSON log correlation for OTel traces#34432brett0000FF wants to merge 1 commit intomasterfrom
Conversation
Preview links (active after the
|
…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.
566a495 to
005e9e3
Compare
|
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. |
|
@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. 🫡 |
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:
@opentelemetry/instrumentation-winstonfor automatic trace context injection.filelogreceiver config usingregex_parser.References
Merge instructions
Merge readiness:
Additional notes
Based on customer feedback requesting guidance for Node.js apps with non-JSON log formats.