Working with OTEL in the reactive code - how does it work? Does it even work? #35137
Unanswered
jan-peremsky
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Our whole BE codebase is built on top of Quarkus.
Our code is fully reactive and command/event driven.
We use Azure CosmosDB as the persistence layer and as the event hub. CosmosDB driver is reactive as well but built on top of the Reactor framework.
Once we tried to produce OTEL based remote tracing info - problems arose.
@WithSpan
does not work on the reactive (Uni<?> returning) methods - the instrumentation creates a Span but just for the pipeline construction phase. The Span is ended long before the subscription and pipeline-execution phase.Calling CosmosDB Reactor pipelines (they use their own thread pools) messes up with Spans even more.
If we receive an asynchronous "command/event" from the CosmosDB event bus - there is no easy way to start a span in order to continue the execution trace.
We ended up creating a utility class which:
withContext
and inject attributes and eventsThis works , however it is very fragile as every Quarkus change might render it broken.
The questions finally:
Beta Was this translation helpful? Give feedback.
All reactions