Skip to content

spring agent - spring gateway4.x  #12635

Closed

Description

@chenxu1986

Search before asking

  • I had searched in the issues 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

image

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

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

Activity

  1. added
    bug
    on Sep 23, 2024
  2. locked and limited conversation to collaborators on Sep 23, 2024
  3. converted this issue into a discussion #12636 on Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions