WO-1582 Refactor tracing span implementations - #7093
Open
jmorrell-cloudflare wants to merge 1 commit into
Open
Conversation
Contributor
|
LGTM |
jmorrell-cloudflare
force-pushed
the
jmorrell/refactor-spans
branch
from
August 25, 2026 02:05
ca17ac6 to
a2aa06b
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.
Preparatory work for
tracing.getActiveSpanWe've ended up with branching logic within
SpanImpl. Mostly now it's whether the span is observed or not:In the next PR I'll be introducing the Invocation span, which will have it's own set of logic. Most notably that we should ignore
.end()as a no-op since that is owned by the platform. This will have more branching logic.And we're likely going to end up with a 4th case, which otel calls a
NonRecordingSpanwhere a span is created representing the remote span that is also a no-op, but does allow children to be created.With that in mind, this moves
SpanImplinto theSpanStateinterface, where we can provide multiple implementations. For nowUserSpanStateandNoopSpanState.If this winds up being easier to review with the next change, I'm happy to combine them.