spring-cloud-gateway traceid does not transmit #3411#3446
spring-cloud-gateway traceid does not transmit #3411#3446wu-sheng merged 5 commits intoapache:masterfrom
Conversation
skywalking-version:6.5.0 spring-gateway-version:2.1.2 Error Description: Customize the filter, traceid does not transmit. "ServerWebExchangeDecorator" is a transport chain,His structure should be like this: serverWebExchangeDecorator -----(ServerWebExchangeDecorator)delegate ------(ServerWebExchangeDecorator)delegate ------..... -----(DefaultServerWebExchange)delegate In the current source code, there is no deep search, but only the next level. When there are multiple custom filters, you get an error. Repair method: Look for "delegate" of "ServerWebExchangeDecorator" recursively until "DefaultServerWebExchange"
spring-boot-starter-webflux-version:2.1.6
Error Description:
Customize the filter, traceid does not transmit.
"ServerWebExchangeDecorator" is a transport chain,His structure should be like this:
serverWebExchangeDecorator
-----(ServerWebExchangeDecorator)delegate
------(ServerWebExchangeDecorator)delegate
------.....
-----(DefaultServerWebExchange)delegate
In the current source code, there is no deep search, but only the next level. When there are multiple custom filters, you get an error.
Repair method:
Look for "delegate" of "ServerWebExchangeDecorator" recursively until "DefaultServerWebExchange"
|
Oh, I may understand, what do you think of using the recursive method, but I hope you add this scenario to the gateway testcase, to make the plugin test more realistic |
|
my test pull request: |
|
CI not pass, please check checkStyle.xml |
|
Modified style to meet "check style" |
|
I had triggered the |
|
Here is the test report and validate logs |
|
Look like @component annotation cause more spans |
|
@zhaoyuguang This should be another issue.We can't restrict other people from using this annotation. |
This is not an issue of this PR, but an issue for your test case. |
|
@wu-sheng I mean, in actual development, there may be people who write as they do in use cases. We can't avoid such problems. But this problem does not fall within the scope of this repair. |
|
The point is, I recommend you to add these spans to your verify files, as expected span. Because in tests, the Spring annotation plugin actives with your gateway plugin. Both of them are optional, the test framework only supports them both active or inactive. |
|
I see what you mean. What you mean is that this annotation activates other plug-ins. I shouldn't do that in use cases. |
|
@zhaoyuguang @wu-sheng Sorry,We just started using "skywalking".I'm not too familiar with the other plug-ins he owns. I updated my use case. |
Ha~, it doesn't matter, I just tested it, |
|
@zhaoyuguang What else do I need to do? |
Just remove |
|
Here is the test report and validate logs |
|
/run e2e |
|
/run e2e |
|
@hi-sb Welcome to be 155th contributor. Welcome to the SkyWalking contributor team. |
skywalking-version:6.5.0
spring-gateway-version:2.1.2
Error Description:
Customize the filter, traceid does not transmit.
"ServerWebExchangeDecorator" is a transport chain,His structure should be like this:
In the current source code, there is no deep search, but only the next level. When there are multiple custom filters, you get an error.
Repair method:
Look for "delegate" of "ServerWebExchangeDecorator" recursively until "DefaultServerWebExchange"
Please answer these questions before submitting pull request
Why submit this pull request?
Bug fix
New feature provided
Improve performance
Related issues
Bug fix
Bug description.
How to fix?
New feature or improvement