This repository was archived by the owner on Nov 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 163
This repository was archived by the owner on Nov 17, 2025. It is now read-only.
Proposal: remove Span #68
Copy link
Copy link
Closed as not planned
Labels
Future DiscussionsThings to look at for future improvementsThings to look at for future improvementsrelease:after-gaNot required before GA release, and not going to work on before GANot required before GA release, and not going to work on before GA
Description
This is obviously controversial, but it would be nice if we removed the concept of the Span from tracing API, and replace it with methods on the Tracer, such as:
tracer.SetSpanAttribute(ctx, key, value)
tracer.RecordSpanEvent(ctx, event)
There are two reasons for that:
- When Context API is moved into an independent layer below all other layers, the way extractors might work is like this:
ctx = extractor.extract(ctx, request). Becauseextract()cannot start a new span, it must store span context in the returnedctx. With this proposal, it will always keep the span context only in the context, never the Span. - Not giving users references to Span objects simplifies memory management. In OpenTracing it was pretty difficult to pool span objects because user can keep a reference to the span even after calling
span.finish(). The tracer can keep a buffer of active spans indexed by immutable span contexts that are kept by the user code. When span is finished the tracer can reuse the span object for another trace. if a later call from user code comes with span context not in the table, trace can either ignore the call, or capture that data by other means (if the backend supports merging of spans).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Future DiscussionsThings to look at for future improvementsThings to look at for future improvementsrelease:after-gaNot required before GA release, and not going to work on before GANot required before GA release, and not going to work on before GA