-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Description
Problem: I have an @Async method, and when I call it, my current span is gone. The same happens when I execute tasks in a AsyncTaskExecutor.
Expectation: Trace propagation should work out of the box. Or there should be something easily findable in the documentation or in the configuration properties.
It looks like context propagation is not enabled for @Async methods. It took some time to find ContextPropagatingTaskDecorator. We don't have any mention on that in the Boot documentation, but Spring Framework's documentation briefly mentions it.
There's also no configuration property to enable that easily.
I'd like to have a ContextPropagatingTaskDecorator bean auto-configured. If that breaks stuff / make stuff slow, maybe behind a configuration property which is opt-in?
If that's not possible, we should add something to our Observability docs which can just hint at ContextPropagatingTaskDecorator.