javaloggingspring-cloud-sleuthzipkin

How to propagate updated baggage key back to client from remote server? || spring cloud sleuth


We are currently using spring cloud sleuth for trace context propagation throughout our microservices and it is working perfectly fine.

I have one requirement where let us say we have three services A,B and C and for every request we receive, we create one custom baggage key at service A and propogate it through B and C.

here is the ask, the flow of any request is like A->B->C . I want to update the Baggage key in service B and propagate this update to A so that server A will start printing new Baggage key in its trace context once it receives response from B.

As a custom solution, we can receive this updated baggage key in the response header and set it on the trace context but I am looking for more clean approach to handle this through sping cloud sleuth.


Solution

  • There's nothing else there in Sleuth / Micrometer Tracing better than what you're currently doing as a custom solution