Conversation
riensen
force-pushed
the
fix/otel-log-context-resolver
branch
from
September 9, 2026 09:03
c4d5c25 to
0a5274e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
OpenTelemetryLogsOutputPlugincallers to provide either a fixed OpenTelemetryContextor a per-record context resolvercontext.active()Root cause
OpenTelemetryLogsOutputPlugin.writeRecord()currently callsLogger.emit()without acontext. The OpenTelemetry Logs SDK therefore snapshotscontext.active()at emit time. In framework integrations, that active context can contain a non-recording span whose span ID is never exported, even when the consumer already has the recording HTTP SERVER span context available. The resulting log record is correlated to a span that cannot be found in the trace backend.This change keeps the plugin framework-agnostic: consumers can supply the correct context directly or resolve it lazily for each log record. There is no xotel-specific behavior.
Validation
npm cinpm run buildnpx mocha src/test/unit-test/otel-output.test.js(3 passing)npm run lintgit diff --checkThe complete
npm testrun reaches 175 passing tests. Two existing dynamic-log-level acceptance tests fail because their checked-in JWT fixtures expired on 2026-07-02; the focused request-context test reproduces the same failures independently of this change.