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
Some MDC data are missing after upgrading Spring Boot to 3.2.1
Context
After bumping my project to Spring Boot 3.2.1 which introduces the newest micrometer-tracing deps, my tests started to fail because of the lack of some attributes in the MDC. I was able to track the issue down to micrometer-tracing-bridge-brave:1.2.1. Downgrading this particular dependency to 1.2.0 solves the problem. (Uncomment build.gradle.kts:47 in the reproducer to downgrade micrometer-tracing-bridge-brave to 1.2.0)
Reproducer contains ContextEnhancingWebFilter filter, which does two things:
add given string as a baggage via Tracer -> ContextEnhancingWebFilter:40
add given string in in Reactor's reactive context -> ContextEnhancingWebFilter: 48Commenting out this line, fixes MDC
Reproducer contains two instances of ContextEnhancingWebFilter in the Srping Context which adds different strings into the context. See ContextEnhancingConfiguration. Having just one such filter does not reproduce the issue
Reproducer tests if given string is being logged correctly (in the MDC context and in the plain, by extracting the string from reactive context)
Expected behaviour
Running tests together, either via IDE or gradle should work.
The text was updated successfully, but these errors were encountered:
If you rewrite this to plain Java do you see the same problem? There are so many moving parts here, Kotlin + Reactor + Context Propagation, let's try one thing at a time.
The issue
Some MDC data are missing after upgrading Spring Boot to 3.2.1
Context
After bumping my project to Spring Boot 3.2.1 which introduces the newest micrometer-tracing deps, my tests started to fail because of the lack of some attributes in the MDC. I was able to track the issue down to micrometer-tracing-bridge-brave:1.2.1. Downgrading this particular dependency to 1.2.0 solves the problem. (Uncomment
build.gradle.kts:47
in the reproducer to downgrade micrometer-tracing-bridge-brave to 1.2.0)Reproducer
I've created minimal reproducer in here: https://github.com/surmabck/spring-boot-3xx-micrometer-issues/tree/micrometer-1.2.1-springboottests-misbehave
Worth to notice
ContextEnhancingWebFilter
filter, which does two things:Tracer
->ContextEnhancingWebFilter:40
ContextEnhancingWebFilter: 48
Commenting out this line, fixes MDCContextEnhancingWebFilter
in the Srping Context which adds different strings into the context. SeeContextEnhancingConfiguration
. Having just one such filter does not reproduce the issueExpected behaviour
Running tests together, either via IDE or gradle should work.
The text was updated successfully, but these errors were encountered: