-
Notifications
You must be signed in to change notification settings - Fork 5
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
Transferring managed span stack from one thread to another #12
Comments
Good point. I hadn't considered this use-case but I can imagine there are situations where this is appropriate. In the current API there's not really a representation for a |
The main difficulty comes from the freedom the SpanManager offers (there is no need for a stack, that's 'incidentally' the way the DefaultSpanManager works). |
Possibly a simple snapshot mechanism for now? |
The idea was that the |
Maybe |
Mention @bhs so you can follow this issue and think about it with your own work in mind 😉 |
@sjoerdtalsma agree there is no obvious solution. I guess there is two separate cases - passing a reference to the current span (handled by The distinction is based on the use case - |
So it shouldn't matter whether implemented as stack or not - just defines the different semantics required by the application. |
I like the direction you're going with this, but am a little worried about comprehension by people. Introducing a second pair of methods for similar but different meaning may be too much. |
Maybe the simplest solution then would be to add an Then the issue is how to mark a |
We would have to be very clear what it means to activate a managed span (e.g. will any current span be cleared, or can it be restored later?) What will the difference between free / deactivated be? |
Ok lets see if others have any suggestions. |
FWIW, in opentracing/opentracing-java#111 I tried to push callers towards a try-with-resources idiom and a Span-aware |
Hi @sjoerdtalsma , any thoughts on a way forward with this issue? Or would you prefer to leave and we get it sorted in opentracing-java? |
Personally I lean towards:
My remaining concern is implementors 'forgetting' to implement that extension interface where applicable. |
That's actually what |
@sjoerdtalsma Yes that makes sense. Any idea when it could be available? :) |
As discussed opentracing/specification#23 (comment) in the ongoing in-process context propagation issue, there may be cases where the trace context must be passed from one thread to another completely (possibly as a 'snapshot'), not just supplying the reference to the current span.
There is currently the
clear
method which disassociates theLinkedManagedSpan
from the thread, but no means of associating it with a new thread.Any thoughts on how this could be done?
The text was updated successfully, but these errors were encountered: