-
Notifications
You must be signed in to change notification settings - Fork 73
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
[WIP] In-process propagation with a simple ITracer.ActiveSpan
property
#36
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cwe1ss I am not familiar with .Net's new async stuff or how the context is propagated across threads, so I cannot offer any opinion on this. Would you be able to poll other .Net developers, maybe whoever participated in earlier PRs/
@carlosalberto any thoughts? |
Definitely sounds all fine to me, specially the part about not needing a few things since async/await help us here (together with AsyncLocal). For the HttpClient and similar components, it looks like there's not much of an option, other than be explicit about it with the users. |
cc += @TerribleDev |
What is the plan for getting the span into the HttpClient request? Have you thought at all about making extension methods of HttpClient that will add the ISpan to the request? httpClient.SentAsync(request, span). Personally, I'd think some extension methods would be pretty nice, because then they would be easy to add to someones code, without having to make sweeping changes across their apps. |
@cwe1ss Any progress on this? The Java propagation API seems stabilized and will soon be released, I can help porting it to c# if it's the right thing to do. |
See #52 as well. (.NET‘s Activity has built in support for propagation via Activity.Current) |
An interesting take would be to prototype out an API/wrapper for |
Out of date. I'll create a new PR with the new scope stuff from Java. EDIT: I'll just look at #50 since it already has that code. |
Related to #35. This PR shows a very simple contract for in-process propagation in C#.
It has the following properties:
ITracer.ActiveSpan
holds the currently active span.ISpanBuilder.IgnoreActiveSpan()
.IActiveSpan
because C# doesn't need the "Continuation" feature from the Java PR.Since this library currently only holds contracts, these rules must be met by tracer implementations. We should discuss separately if there are any building blocks that should go into this library or a contrib project.
Things that are not possible with this right now:
ISpanBuilder.IgnoreActiveSpan()
Questions:
ISpan.Parent
orISpanContext.Parent
)Usage: