Skip to content

Span baggage processor & no Baggage When Start #7677

@AndresBena19

Description

@AndresBena19

Describe the bug
The BaggageSpanProcessor is currently listening on Start for every span and getting the baggage from the context, but as the SpanBuilderShim is not setting the baggage data that point when the SpanProcessor intercept the start, there is not baggage to attach

io.opentelemetry.api.trace.Span span = builder.startSpan();

https://github.com/open-telemetry/opentelemetry-java-contrib/blob/c2c62aa97383412663fbe198c4259e17ea26ac6b/baggage-processor/src/main/java/io/opentelemetry/contrib/baggage/processor/BaggageSpanProcessor.java#L40

I found while working with this temporal open tracing interceptors

https://github.com/temporalio/sdk-java/blob/c67ca608d88e78f942dfaa4a0f4280f95e35d012/temporal-opentracing/src/main/java/io/temporal/opentracing/internal/OpenTracingWorkflowClientCallsInterceptor.java#L30

Steps to reproduce
If possible, provide a recipe for reproducing the error.

What did you expect to see?
Expected to see the context extracting the baggage data from the parent context and propagate baggage to the span attributes

What did you see instead?
Baggage .fromContext no finding baggage data

What version and what artifacts are you using?
Artifacts: (e.g., opentelemetry-api, opentelemetry-sdk, which exporters, etc)
Version: (e.g., v0.4.0, 1eb551b, etc)
How did you reference these artifacts? (excerpt from your build.gradle, pom.xml, etc)

Environment
Compiler: (e.g., "Temurin 17.0.7")
OS: (e.g., "Ubuntu 20.04")
Runtime (if different from JDK above): (e.g., "Oracle JRE 8u251")
OS (if different from OS compiled on): (e.g., "Windows Server 2019")

Additional context
Add any other context about the problem here.

Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions