how SpringCloud Gateway add traceId to response header? #10686
-
how SpringCloud Gateway add traceId to response header? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 12 replies
-
spring cloud gateway 3.1.x |
Beta Was this translation helpful? Give feedback.
-
ClientHttpRequest clientHttpRequest = (ClientHttpRequest) allArguments[0];
ContextCarrier contextCarrier = (ContextCarrier) objInst.getSkyWalkingDynamicField();
CarrierItem next = contextCarrier.items();
while (next.hasNext()) {
next = next.next();
clientHttpRequest.getHeaders().set(next.getHeadKey(), next.getHeadValue());
} |
Beta Was this translation helpful? Give feedback.
-
I just tried 8.15.0, but it does not work as also.
prints as follow
|
Beta Was this translation helpful? Give feedback.
-
hello , if don't use WebFluxSkyWalkingOperators.continueTracing and not import webflux plugins . what will happen? |
Beta Was this translation helpful? Give feedback.
String traceId = WebFluxSkyWalkingOperators.continueTracing(exchange, TraceContext::traceId);
exchange is
org.springframework.web.server.ServerWebExchange