Allow defining the "Active Span"
See original GitHub issueProblem Statement
Integrations such as SentryHttpMesageHandler
rely on
_hub.GetSpan()?.StartChild
to create a span. This on the Hub today is wired as:
public ISpan? GetSpan() => Transaction?.GetLastActiveSpan() ?? Transaction;
This means I can’t set a specific span to get returned from GetSpan
. When parallelizing work, the parent/child relationship becomes messy since there are multiple spans “active” and relying on the root transaction isn’t possible to find out which one it is.
Solution Brainstorm
When we’re propagating the span explicitly downstream. A user can push a scope and set that new span as the active one. So integrations can find the correct parent span.
For example _hub.SetActiveSpan(span)
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Add span tags and filter and group your application ...
The Datadog UI uses tags to set span level metadata. Custom tags may be set for auto-instrumentation by grabbing the active span from...
Read more >Manual Instrumentation
To create Spans, you only need to specify the name of the span. The start and end time of the span is automatically...
Read more >Get the currently active span from implicit context
Set the currently active span to the implicit context. This is equivalent to getting the implicit context, then inserting the Span to the ......
Read more >Chapter: Configuring SPAN and RSPAN
SPAN sessions (local or remote) allow you to monitor traffic on one or more ports, or one or more VLANs, and send the...
Read more >OpenTelemetry Distributed Tracing [complete guide]
To group spans properly, give them short and concise names. The total number of unique span names should be less than 1000.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Related to #1679.
Fixed in #2364