Skip to content

Consider auto-configuring a ContextPropagatingTaskDecorator bean #47893

@mhalbritter

Description

@mhalbritter

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.

@chemicL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions