There's a couple of "context propagation" issues in this issue tracker already, but I think this deserves its own :-)
Say I have a CDI bean with a @Traced method, which returns a CompletionStage. This can be for example:
- a method that is annotated with MP Fault Tolerance
@Asynchronous and therefore is executed on an extra thread
- a method that uses MP Context Propagation's
ManagedExecutor to defer execution of some part of the method
Such method can be called for example from a JAX-RS endpoint, where the method also returns CompletionStage (this is standard since JAX-RS 2.1).
In such case, whatever is done to the span asynchronously (after the @Traced method returns) may be lost, and that is even if I hack together OpenTracing context propagation (which we've done in SmallRye Fault Tolerance). This is because the @Traced interceptor closes the scope synchronously. That's of course a correct/specified behavior, but I think it's also rather suboptimal.
We should find a way how to make these scenarios work. Integrating with Context Propagation is necessary, but not enough.
There's a couple of "context propagation" issues in this issue tracker already, but I think this deserves its own :-)
Say I have a CDI bean with a
@Tracedmethod, which returns aCompletionStage. This can be for example:@Asynchronousand therefore is executed on an extra threadManagedExecutorto defer execution of some part of the methodSuch method can be called for example from a JAX-RS endpoint, where the method also returns
CompletionStage(this is standard since JAX-RS 2.1).In such case, whatever is done to the span asynchronously (after the
@Tracedmethod returns) may be lost, and that is even if I hack together OpenTracing context propagation (which we've done in SmallRye Fault Tolerance). This is because the@Tracedinterceptor closes the scope synchronously. That's of course a correct/specified behavior, but I think it's also rather suboptimal.We should find a way how to make these scenarios work. Integrating with Context Propagation is necessary, but not enough.