0

Quick question on how to pass around the original trace id traceId please.

The entire end to end flow is a call between a client ClientA to three other micro services (four in total).

ClientA (team A) -> Service B1 (team B) -> Service B2 (team B) -> Service C (team C)

Team A owns the client, the originator of the call, team C owns the last service.

My group, team B owns two out of the four micro services.

All subsequent micro services just perform computation and aggregate the response of each other back to the caller, ClientA.

Our team, B, had two micro services, hence we were the first out of the four to use Spring Cloud Sleuth and Zipkin.

Very happy, we could see out of the four services, in our services only, the traceId.

[serviceBone,24ccc8d03f686f2e,...]  
[serviceBtwo,24ccc8d03f686f2e,...] 

This is helping us in debugging, timing calls, etc, very happy.

Since everyone saw benefits, now ClientA and ServiceC (the two others we do not own) also integrated with Sleuth-Zipkin.

Unfortunately, it seems we are not able to "chain everything".

We looked at each others traceId, and saw something like:

[clientA,31f79eac76b305a9,...]  

[serviceBone,d5396495f621e993,...]  
[serviceBtwo,d5396495f621e993,...] 

[serviceC,fb381ef109c13eef,...]

Hence, we are now all very puzzled. As we thought we would see something like:

[clientA,31f79eac76b305a9,...]  

[serviceBone,31f79eac76b305a9,...]  
[serviceBtwo,31f79eac76b305a9,...] 

[serviceC,31f79eac76b305a9,...]

Since for the two servicesB1 and B2, we did not do anything in particular, out of the box, we could see same traceId between the two, we thought, out of the box, we would be able to see between the four services.

May I ask, is my understanding not correct?

What did I miss please?

Do I have to do anything special, if yes, what, in order to ask ClientA to send me its traceId?

Or maybe ClientA is already sending it, I am not getting it properly? (same applies to ServiceC)

Thank you for your help.

PatPanda
  • 3,644
  • 9
  • 58
  • 154
  • How did you add Sleuth to your service? How is it configured? How do you perform requests to the other service? – cassiomolin Apr 26 '21 at 21:53
  • How did you add Sleuth to your service? -> Just importing the Spring Cloud dependencies, and spring-cloud-starter-sleuth + spring-cloud-sleuth-zipkin dependencies – PatPanda Apr 26 '21 at 22:29
  • How is it configured? -> No special configuration except the Zipkin server host – PatPanda Apr 26 '21 at 22:29
  • How do you perform requests to the other service? -> I use a Spring Webflux WebClient – PatPanda Apr 26 '21 at 22:30
  • What’s the version of those artifacts? And what’s the version of Spring Boot and Spring Cloud? – cassiomolin Apr 26 '21 at 22:39
  • I am using the SpringBoot 2.4.4 + Spring Cloud 2020.0.0 – PatPanda Apr 26 '21 at 22:46
  • To be honest, I remember some issues with Sleuth and Webflux in older versions. Not sure about these versions though. Have you tried to use `RestTemplate` for this request? Have you noticed any difference? – cassiomolin Apr 26 '21 at 22:50

0 Answers0