chenxu1986 opened a new issue, #12635:
URL: https://github.com/apache/skywalking/issues/12635

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Apache SkyWalking Component
   
   Java Agent (apache/skywalking-java)
   
   ### What happened
   
   my project use spring boot 3.2, spring-could-starter-gateway version is 4.1.5
   I use skywalking agent version is  9.3.0, oapserver version is 9.3.0
   
   I put the option-plugin  “apm-spring-cloud-gateway-4.x-plugin-9.3.0.jar”  
and  “apm-spring-webflux-6.x-plugin-9.3.0.jar”   into the agent dir。
   
   Then I conducted tests and found the following issues:
   
   In the gateway service, a request is split into two spans, as shown in the 
following figure. SpringCloudGateway/RoutingFilter  and 
/testsk/api/inner/login/loginPwd are the same request, and you can see that 
their trace IDs are the same, but they are displayed as two on SK UI. Upon 
closer inspection, it is found that their segment IDs are different. Normally, 
they are all on the same gateway instance, and the segmentation ID should be 
consistent。
   
   
![image](https://github.com/user-attachments/assets/37945d82-50c7-4362-be28-043f3c1bea35)
   
   
   
![image](https://github.com/user-attachments/assets/2da93b82-bc6a-40ad-8845-c2d2aeb54c00)
   
   
   
   The downstream service user, traceid of the gateway is completely different 
from that of the gateway, and has not received the traceid passed down by the 
gateway
   
   
![image](https://github.com/user-attachments/assets/7d1925fe-ebd4-4d23-a1e8-9f4d2b9d2de4)
   
   So, my problem is that there is a problem with the trace passing inside the 
gateway. I traced the source code of the agent and found that in 
NettyRoutingFilterInterceptor, the afterMethod was executed before the 
subsequent call was initiated, causing ContextManager. stopSpan();. After 
exiting span, FHIR FinalizerSendInterceptor was executed, and ContextManager. 
isActive() became null, causing the traceid not to be passed down.
   I don't know if I debugged it wrong, but I hope the trace information can be 
processed correctly within the gateway. I hope everyone can help me
   
   
   
   ### What you expected to happen
   
   I hope the trace information can be processed correctly within the gateway. 
I hope everyone can help me
   
   ### How to reproduce
   
   Describe the steps in the previous section
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [ ] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to