Open turneand opened 6 months ago
I believe you need micrometer context propagation on the classpath //cc @dstepanov
Ah, perfect, so I found the documentation around the micronaut-context-propagation, but clearly missed this one. What really confused me is that when using the auto-instrumentation of the http methods via micronaut-tracing-opentelemetry-http, then the context is setup, so then presume this is done a different way? But, that at least sorts out my immediate issue, thanks
Unfortunately adding micrometer context propagation appears to break micronaut-data transaction propagation, so can't actually add it in for now. I've raised that under https://github.com/micronaut-projects/micronaut-data/issues/2835
Expected Behavior
When annotating reactive methods with NewSpan/WithSpan the trace context should be propagated.
Actual Behaviour
Following the documentation under https://micronaut-projects.github.io/micronaut-tracing/latest/guide/index.html#opentelemetry (although no reactive examples, the notes at https://micronaut-projects.github.io/micronaut-tracing/latest/guide/index.html#introduction indicate reactive types are supported).
A simple reactive method like the following:
Is not able to read the correct values from Span.current(), instead it indicates that no span is present. Note, that for this sample "micronaut-tracing-opentelemetry" is a dependency, but "micronaut-tracing-opentelemetry-http" is not ... If we use micronaut-tracing-opentelemetry-http, then the overall context is propagated, but any sub-span are not correctly propagated down.
Steps To Reproduce
With the dependencies:
And the controller class:
When run locally, we get results as below: /hello - to hit the non-reactive endpoint, the current span logged is valid
/helloReactive - to hit the reactive endpoint, the current span logged is invalid
Environment Information
windows / unix java 17
Example Application
https://github.com/turneand/micronaut-tracing
Version
4.3.4