feat: add otel logger injection#427
Open
wangyb-A wants to merge 1 commit into
Open
Conversation
wangyb-A
commented
Jun 9, 2026
Comment on lines
+157
to
+160
| 2. The invocation span from the plugin registry. This is the path used | ||
| for top-level handler code: the invocation span is never attached to | ||
| the worker thread's context, so the registry is the only way to | ||
| resolve it. |
Contributor
Author
There was a problem hiding this comment.
Currently, on_invocation_start is running on main thread (instead of worker thread). So, even if we attach the span to the context, it's invisible for worker thread.
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.
Issue #, if available: #
Description
wrap_loggerhook to DurableInstrumentationPlugin and chain it inPluginExecutor.wrap_logger.OtelEnrichedLoggerthat injects the active span context into each log extra.get_current_span_context: the active operation span inside a step/child context, the enclosing operation span between steps, and the invocation span (from the registry) at the top level.on_user_function_endnow restores the enclosing operation span (parent_id) rather than always the invocation span, so between-step logs inside a child context correlate to that child context.Testing