Spring jaeger propagating span to an Async method

1.8k Views Asked by At

I have a simple Spring Boot 2.x RestController with an endpoint performing certain remote calls as well as controller is also calling an Async method that in turn makes several remote HTTP calls.

I'm having opentracing-spring-jaeger-web-starter in classpath with tracing enabled. If i invoke my REST endpoint, It creates a span for the endpoint call as well as remote calls that the controller is making synchronously.

However the remote calls made by Async method is getting reported in its own span. Is this by design or is there a way to propagate some context information to the Async method to better group/relate the spans ?

1

There are 1 best solutions below

0
On

I solved it by using this library instead https://github.com/opentracing-contrib/java-spring-cloud

It seem to have an option to enable or disable different instrumentation feature. Read about opentracing.spring.cloud.async.enabled for more info.