Unfortunately Spring Sleuth is not compatible with Spring Boot 3, so I'm looking for a way to pass B3 header with HTTP request done by Spring WebClient.
I think, it should be something like
brave's TracingClientHttpRequestInterceptor, but for Spring WebClient.
or Spring Sleuth's TraceExchangeFilterFunction, but Spring Boot 3.
I also found io.projectreactor.netty:reactor-netty-http-brave as WebClient uses netty, but it seems deprecated.
If you want Spring Boot 3 and Distributed Tracing, you should use Micrometer Tracing instead of Sleuth.
Spring Boot 3.0.0 was released with configuring support for the W3C format. This was possible to override by Java config but now properties were added so that you can set which propagation format you want to use from properties: https://github.com/spring-projects/spring-boot/pull/35611
The supported formats by default were also extended:
management.tracing.propagation.consume // default: [W3C, B3, B3_MULTI]
management.tracing.propagation.produce // default: [W3C]
management.tracing.propagation.type
So if you want to use B3, you can upgrade to the latest version and set management.tracing.propagation.type=B3 or just set management.tracing.propagation.produce=B3.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With