-
Notifications
You must be signed in to change notification settings - Fork 321
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
When using weblux, different requests get the same traceid #2070
Comments
Hi @LeePui , We don´t have automatic instrumentation available for Spring Gateway, thus I assume that you are trying to work-around that limitation by propagating the headers yourself to the Webflux client, is that right ? First, we currently have a PR (#1948) that changes a bit Webflux instrumentation that is about to be merged, would you mind testing with this snapshot to be sure that the observed behavior is still present ? From what I understand, the Spring Gateway provides Webflux server endpoints and delegates execution to Webflux client.
All the points 2 to 4 should be handled by the automatic instrumentation of Webflux client. What likely happens in your case is that you have a single transaction that does multiple downstream HTTP requests, which explains why you see many times the same transaction ID. |
Hi @SylvainJuge , |
So, if I understand correctly here, the end-to-end request workflow is the following:
Can you confirm that properly describes your case here ? What is not really clear to me are the following points:
|
yes, the request workflow is right.
and i use API in gateway like this:
i do stress tests in 1.24.0 and 1.25.1-SNAPSHOT.jar, use 20 thread, each thread loop 10 times。
and 1.25.1-SNAPSHOT.jar will get a empty traceId. if i replace |
There are multiple issues here, thus we will proceed step by step to make that more clear, starting from the upstream gateway then going to the downstream service.
|
ok,thank you |
apm-agent version:1.25.0
VM options:-javaagent:elastic-apm-agent-1.25.0.jar -Delastic.apm.enable_experimental_instrumentations=true -Delastic.apm.use_path_as_transaction_name=true
i use apm-agent-api in spring gateway,i want to get the traceid and transmit it to downstream applications,i use WebFilter :
`public class MyWebFilter implements WebFilter, Ordered {
}`
when i sent some request, i found the same traceid:
![image](https://user-images.githubusercontent.com/14257862/130177050-6a4f3c81-fe0f-497b-a6a3-2ab154a9eb7a.png)
The text was updated successfully, but these errors were encountered: