How adap Sleuth headers to make them compatible with OpenTracing

Tags: , , ,



I’m working on a big stack of micro services written in Spring Boot, those services are using spring-cloud-starter-sleuth in order to trace the calls between several services.

My concern is that I have implemented a new service based on Quarkus and the quarkus-smallrye-opentracing doesn’t recognize header sent by Sleuth.

I cannot modify the existing services using Sleuth and so I’m looking for a way to convert the headers sent by Sleuth to make them compatible with opentracing.

Sleuth sent headers like :

  • X-B3-Spanid
  • X-B3-Traceid
  • ...

Is there a way to achieve such conversion in Quarkus?

I looked at various post like this one Spring Cloud Sleuth with OpenTracing But it’s not very helpful as I cannot touch the existing services in Spring…

Thanks in advance.

Answer

By default, Quarkus is using Jaeger as OpenTracing implementation.

Jaeger is using “Uber” propagation headers, which are different from the one used by Spring Sleuth (B3)

You can configure Quarkus to use B3 propagation to work with Spring Sleuth with property:
quarkus.jaeger.propagation=b3

https://quarkus.io/guides/opentracing#quarkus-jaeger_quarkus.jaeger.propagation



Source: stackoverflow