Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Baggage is not propagated by OpenTracing bridge #2793

Open
bboreham opened this issue Apr 18, 2022 · 7 comments
Open

Baggage is not propagated by OpenTracing bridge #2793

bboreham opened this issue Apr 18, 2022 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed pkg:bridges Related to a bridge package
Projects

Comments

@bboreham
Copy link
Contributor

Description

When using BridgeTracer, after Inject the Carrier has no entries for baggage.
After Extract the resulting SpanContext has nil in the baggage field.

Environment

  • OS: Linux
  • Architecture: ARM64 (M1)
  • Go Version: go1.17.1 darwin/arm64
  • opentelemetry-go version: 1884de2, shortly after v1.6.3

Steps To Reproduce

Starting with the test from #2141, add some baggage:
bboreham@c162bdd

Observe the test now fails:

go test -run ^TestHeaderCarrier$ go.opentelemetry.io/otel/bridge/opentracing
--- FAIL: TestHeaderCarrier (0.00s)
    /Users/bryan/src/github.com/open-telemetry/opentelemetry-go/bridge/opentracing/bridge_test.go:93: Extracted span context does not match: 
&opentracing.bridgeSpanContext{bag:baggage.Baggage{list:baggage.List{"Foo":baggage.Item{Value:"bar", Properties:[]baggage.Property(nil)}}}, otelSpanContext:trace.SpanContext{traceID:trace.TraceID{0x5e, 0xb4, 0x86, 0x1, 0x52, 0xcc, 0x3b, 0x6a, 0xab, 0xdd, 0x71, 0x2f, 0xe7, 0x5a, 0x7d, 0x54}, spanID:trace.SpanID{0x41, 0x3f, 0xec, 0x7c, 0x4b, 0xec, 0xea, 0x13}, traceFlags:0x0, traceState:trace.TraceState{list:[]trace.member(nil)}, remote:false}}, 
&opentracing.bridgeSpanContext{bag:baggage.Baggage{list:baggage.List(nil)}, otelSpanContext:trace.SpanContext{traceID:trace.TraceID{0x5e, 0xb4, 0x86, 0x1, 0x52, 0xcc, 0x3b, 0x6a, 0xab, 0xdd, 0x71, 0x2f, 0xe7, 0x5a, 0x7d, 0x54}, spanID:trace.SpanID{0x41, 0x3f, 0xec, 0x7c, 0x4b, 0xec, 0xea, 0x13}, traceFlags:0x0, traceState:trace.TraceState{list:[]trace.member(nil)}, remote:true}}

Expected behavior

Baggage should be propagated.

Commentary

There are lines in BridgeTracer.Inject and Extract aimed at doing something with baggage:

ctx = baggage.ContextWithBaggage(ctx, bridgeSC.bag)

baggage := baggage.FromContext(ctx)

However the propagator Inject and Extract methods do not seem to line up with this code's expectations.

@bboreham bboreham added the bug Something isn't working label Apr 18, 2022
@MrAlias MrAlias added this to Needs triage in Bugs via automation May 3, 2022
@MrAlias MrAlias added the help wanted Extra attention is needed label May 3, 2022
@MrAlias MrAlias moved this from Needs triage to Low priority in Bugs May 3, 2022
@MrAlias MrAlias added the pkg:bridges Related to a bridge package label May 5, 2022
@anshul35
Copy link

Hi ,

Can I take this bug ?

@shubham-bansal96
Copy link

shubham-bansal96 commented Apr 6, 2023

@MrAlias @MadVikingGod
I would like to work on this. Could you please provide me any entry point from where I can start ?

@shubham-bansal96
Copy link

@bboreham
I am not able to reproduce this issue, could you please provide me few more details regarding replicating steps ?

@bboreham
Copy link
Contributor Author

bboreham commented Apr 7, 2023

You tried the test at the commit I linked?

@shubham-bansal96
Copy link

Thanks @bboreham , Now i am able to reproduce this.

@scorpionknifes
Copy link
Member

scorpionknifes commented Dec 21, 2023

The following fixes the example given in bboreham@c162bdd

- otel.SetTextMapPropagator(propagation.TraceContext{})
+ otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))

This is expected behaviour, I've written a test in #4776 to cover this.

No changes needed, happy to close this

@pellared
Copy link
Member

@bboreham Can you please check #2793 (comment)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed pkg:bridges Related to a bridge package
Projects
Status: Low priority
Bugs
  
Low priority
Development

Successfully merging a pull request may close this issue.

6 participants