You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With spring boot 3 reactive services the logs from logbook are not using traceId and spanId.
Description
Logs from reactive services are not showing the traceId (and in some cases the spanId).
I have two services, the first one invokes the second one using a webclient.
Logs for the first service:
I'm using Spring Boot 3 + Spring Webflux + Logbook Spring Webflux + Kotlinx Coroutine Reactor + Netty Http Brave
Migrating from Spring Boot 2 (w/ Spring Sleuth) to Spring Boot 3 (w/ Micrometer) is being a real pain.
For instance, I have the opposite of your issue: My MDC is correctly traced (kind of) for my internal WebClient calls (i use tracer.createBaggageInScope function to add them into the context), but not my Netty HTTP Server request/response (which is logged after the web client calls too !)
Using Hooks.enableAutomaticContextPropagation() or not does not matter.
Any help is appreciated !
EDIT: I have also created an issue on Reactor Netty here for those who are struggling to log the context in a Spring Boot 3 Webflux + Coroutine environment.
EDIT 2 After a few tests, it seems that calling Hooks.enableAutomaticContextPropagation() make the MDC no longer logged. It seems like there is an issue with Logbook and Reactor integration. I will probably create an issue soon with an example.
In short, Logbook prints the "message" part of the log; the rest (like timestaps, thread names, MDC) is handled by SLF4J/Logback. The above discussion shows one possible resolution, though it's unrelated to Logbook.
With spring boot 3 reactive services the logs from logbook are not using traceId and spanId.
Description
Logs from reactive services are not showing the traceId (and in some cases the spanId).
I have two services, the first one invokes the second one using a webclient.
Logs for the first service:
and the logs for the second service:
Expected Behavior
TraceId and spanId should be present in logbook logs.
Steps to Reproduce
In this project you can find all you need to reproduce the error and more information:
https://github.com/lzhaza77/spring-boot-3-logbook-reactive
Your Environment
The text was updated successfully, but these errors were encountered: