[#16670] dist-trace: async scope-carry across thread hops - #14
Open
ellabaron-code wants to merge 1 commit into
Open
[#16670] dist-trace: async scope-carry across thread hops#14ellabaron-code wants to merge 1 commit into
ellabaron-code wants to merge 1 commit into
Conversation
Author
|
Misfiled: reopening against yugabyte/yugabyte-db. |
ellabaron-code
force-pushed
the
dist-trace-03-scopecarry
branch
from
July 11, 2026 02:15
9c05fe5 to
9ce570b
Compare
ellabaron-code
force-pushed
the
dist-trace-02-distlib
branch
from
July 11, 2026 02:15
bd290ce to
28f5f4f
Compare
ellabaron-code
force-pushed
the
dist-trace-02-distlib
branch
from
July 13, 2026 15:13
28f5f4f to
24f800a
Compare
ellabaron-code
force-pushed
the
dist-trace-03-scopecarry
branch
from
July 13, 2026 15:13
9ce570b to
e20a47f
Compare
Carry the active OTel trace context across thread boundaries so work
resumed on a worker/reactor thread nests under the trace that submitted
it. Each carrier captures dist_trace::GetActiveSpanContext() where the
scope is still live (Enqueue / construction) and re-establishes it with
dist_trace::ActivateParentScope() around the deferred callback.
- util/thread_pool: ThreadPoolTask carries trace_parent_; captured in
YBThreadPool::Enqueue and TaskRecipient::StampTraceContext, re-activated
in the worker loop and FunctorThreadPoolTask::Run.
- util/strand: StrandTask carries trace_parent_; captured in
Strand::Enqueue, re-activated in Strand::Task::Done.
- rpc/scheduler: ScheduledTaskBase captures at construction, re-activates
in ScheduledTask{,WithId}::Run.
- rpc/periodic: PeriodicTimer captures at construction, re-activates in
Callback before running the task.
- rpc/rpc: RpcRetrier captures at construction, re-activates in DoRetry
before rebuilding the OutboundCall (carries the parent across retries).
Purely additive; all no-ops when the captured context is invalid.
ellabaron-code
force-pushed
the
dist-trace-02-distlib
branch
from
July 13, 2026 16:12
24f800a to
77539c4
Compare
ellabaron-code
force-pushed
the
dist-trace-03-scopecarry
branch
from
July 13, 2026 16:12
e20a47f to
61c5f9e
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.
Carry the active OTel trace context across thread boundaries so work
resumed on a worker/reactor thread nests under the trace that submitted
it. Each carrier captures dist_trace::GetActiveSpanContext() where the
scope is still live (Enqueue / construction) and re-establishes it with
dist_trace::ActivateParentScope() around the deferred callback.
YBThreadPool::Enqueue and TaskRecipient::StampTraceContext, re-activated
in the worker loop and FunctorThreadPoolTask::Run.
Strand::Enqueue, re-activated in Strand::Task::Done.
in ScheduledTask{,WithId}::Run.
Callback before running the task.
before rebuilding the OutboundCall (carries the parent across retries).
Purely additive; all no-ops when the captured context is invalid.