-
Notifications
You must be signed in to change notification settings - Fork 565
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
The current active span is not considered while creating a child span in WebClientTracing #5216
Comments
With Helidon SE there is “no magic” and the developer has the flexibility (and therefore the responsibility) of complete control. You need to prepare some context so that the Helidon tracing code can find what it needs. Something like the following code in the service endpoint handler method should set things up so Helidon's code will create the span for the outbound WebClient request however you want:
Two other notes:
|
@tomas-langer and @Verdent Is there any reason we should not use the currently-active span as the parent in this use case, assuming that the span context is absent from the request context? |
@tomas-langer Reminded me that, in Helidon SE and WebClient, span context is kept in As a result, we do not want to use a possibly-incorrect "current" span. |
Re-opening this issue for 4.x. In a virtual threads environment, as in 4.x, the outbound WebClient request will normally be on the same thread as the incoming request, so the WebClient request span could be parented to the current span if there is one. |
#8957 |
The current active span is not considered while creating a child span in WebClientTracing. It's always referring to the span context that exists in the server request.
Environment Details
Problem Description
I'm creating the first span as a child of the span context that exists within the server request. The second span I'm creating as a child of the first span. The code where the second span is active is making the outbound call.
The outbound call is intercepted by WebClientTracing and creates a span. Instead of reading the current active span from the scope manager, it's reading the span context that exists in the server request and creating a new span.
With this tracing tree, the parent-child relationship is not correct.
[WebClientTracing.java](https://github.com/helidon-io/helidon/blob/helidon-2.x/webclient/tracing/src/main/java/io/helidon/webclient/tracing/WebClientTracing.java#L61)
Expected:
Actual:
I'm doing the below workaround for now.
Steps to reproduce
Should I go ahead with the workaround since we don't have ScopeManager anymore in Helidon 3.X.X?
The text was updated successfully, but these errors were encountered: