Closed as not planned
Closed as not planned
Description
Versions: 3.1.6 and 3.2.0 (works as expected in 3.1.5)
Using Micrometer OpenTelemetry bridge with W3C context propagation, with Webflux and actuator. Enable automatic reactor context propagation, in 3.2.0 this is is done by spring.reactor.context-propagation=auto
.
Minimal reproduction of the issue:
- Clone https://github.com/jamesmoessis/tracing-bug-demo
- Run the main application
curl -H 'traceparent: 00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01' http://localhost:8080/hello
You will see that the controller errors out, returning 500 because thetracer.getCurrentSpan()
returns null.
Message:
java.lang.NullPointerException: Cannot invoke "io.micrometer.tracing.Span.context()" because the return value of "io.micrometer.tracing.Tracer.currentSpan()" is null
Expected: the current span will be available and the trace ID will be returned by the controller. This is the behaviour if you change the SB version to 3.1.5. This seems to only happen when the handler returns a Mono
or Flux
.