Skip to content

Spring Webflux Context issue with TRACE_CONTEXT_KEY #13475

@dlefler-chwy

Description

@dlefler-chwy

I have been attempting to get open telemetry working in my Spring Webflux application. The application uses a data dog java agent. Below is the configuration:

Spring boot version: 3.4.1
Spring webflux version: 6.2.1
opentelemetry-sdk version: 1.47.0
opentelemetry-api version: 1.47.0
opentelemetry-sdk-extension-autoconfigure: 1.47.0
opentelemetry-spring-webflux-5.3: 2.12.0-alpha

I am able to successfully instrument my application using just the open telemetry api. However, I want to add custom span attributes to my spans and in order to do this, I added opentelemetry-spring-webflux-5.3: 2.12.0-alpha. The reason I thought that this library would help access the correct span was that TRACE_CONTEXT_KEY would be added to the reactor context. When debugging my application, I do not see this in the reactor context and stepping through the code,storeOpenTelemetryContext is never called.

Is there something wrong with the way I have set this up? I have set up the correct beans following the README for the webflux library. Any help would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions