spring-projects / spring-boot

Spring Boot
https://spring.io/projects/spring-boot
Apache License 2.0
74.5k stars 40.53k forks source link

Context not propagated in a reactive programming, OpenTelemetry context is not available #42039

Closed tadlakha9 closed 2 weeks ago

tadlakha9 commented 2 weeks ago

We are facing an issue with spring boot 3.3.1, TraceContext is lost in between while processing the micrometer tracer object

java.lang.NullPointerException: Cannot invoke "io.micrometer.tracing.Span.context()" because the return value of "io.micrometer.tracing.Tracer.currentSpan()" is null

Our Observation When we call an api in microservice 1, tracer.currentSpan().context() is available but while trying to extract the traceId from TraceContext we are not getting the value

Sample projects

https://github.com/tadlakha9/micro1 https://github.com/tadlakha9/micro2

actually when we call an api, we get the tracer with currentSpan later currentSpan got lost in between. We have similar issue in the past as well.

bclozel commented 2 weeks ago

Duplicates #42031 - we will consider your comment there, no need to create duplicate issues.