The userId set through TraceContext.putCorrelation("user", userId.toString()) in the gateway is not propagated to the downstream system. #11367
-
In agent version 9.0, when trying to retrieve the correlation value using TraceContext.getCorrelation("user") in the downstream system, it returns an empty result. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
|
Does your tracing continue? If the trace breaks, this breaks. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you very much for taking the time to answer my questions. Most of the content available online about Skywalking is focused on basic setup tutorials, and the few articles on advanced features are vague and lack practical reference value. The official documentation for the Java agent is also quite simple. It seems that I'll have to debug it myself. In any case, I'm really grateful for your help.
…---Original---
From: "吴晟 Wu ***@***.***>
Date: Tue, Oct 3, 2023 08:34 AM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [apache/skywalking] The userId set throughTraceContext.putCorrelation("user", userId.toString()) in the gateway is notpropagated to the downstream system. (Discussion #11367)
Spring Gateway is complex as always. I don't know enough about that, as it is just a simple plugin from a maintainer's perspective. However the end users of Gateway have various ways of using it. So, from what I saw, your way is not supported.
You need to debug the plugins and understand the codes by yourself. Or, just wait for someone from the community have known what this means. But most likely, this would not be from a maintainer. AFAIK, no maintainer is working on any specific plugin.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
@hgaong spring-cloud-gateway use webflux, it propagate tracingcontext by dynamicfield on ServerWebExchange, you can change your code like this: WebFluxSkyWalkingTraceContext provided by for more details, you can ref: WebFluxSkyWalkingCorrelationContextPutInterceptor.java And there is an chinese article about correlation write by someone, I think it can help you understand it well: |
Beta Was this translation helpful? Give feedback.









@hgaong
TraceContext.putCorrelation("xx", "xx")need an active span in current thread. In custom gateway filter, it does not exist.spring-cloud-gateway use webflux, it propagate tracingcontext by dynamicfield on ServerWebExchange, you can change your code like this:
WebFluxSkyWalkingTraceContext provided by
apm-toolkit-…