-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trace: Add custom span generator. #5725
Comments
You should write a specification change before this can be part of the stable API. |
There is no guarantee that a span reference is released when it is ended. Your pool members are leaking. If the core of this proposal is to use a pool of spans, this will be flawed. |
@MrAlias Guaranteed span release is achieved by the user. The user can guarantee that span is not used after span.end(), they can inject the span generator to achieve pool of spans. This issue just wants to support injecting a span generator and provide default span generation. |
How does the user ensure things like the |
In function opentelemetry-go/sdk/trace/span.go Line 432 in 002c0a4
|
How is allocating a snapshot in addition to the |
How do you account for the cases where you do not manage the span? For example third-party instrumentation? |
We can also use pools for snapshots as well. Recycle the snapshots in the
|
I have not used third-party instrumentation. Pool of spans can be implemented via the generator when the user can manage spans. That's just an option... |
The specific use case you are mentioning describes one where that specific user should implement their own SDK. Having such a specific and potentially dangerous design in the general purpose SDK contained here would be a misstep. |
Again, then how do you know you are done with the reference to the the snapshot? How can the SDK, who owns the pool, guarantee the members of the pool are not leaked when they are passed to other entities? |
What is the potential dangerousness here? Span of user implementation? I think the |
I would like to support reuse of Span to reduce memory usage.
Support for setting up span generators.
For asynchronous tracking, new ParentSpan needs to be copied in CopyCtx().
In addition, Span's life cycle should end after the Span.End() method call.
Exporter uses a snapshot of the span.
The text was updated successfully, but these errors were encountered: