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

[OpenTracing Bridge] Support baggage-only propagation #3999

Open
ChenX1993 opened this issue Apr 14, 2023 · 0 comments · May be fixed by #4000
Open

[OpenTracing Bridge] Support baggage-only propagation #3999

ChenX1993 opened this issue Apr 14, 2023 · 0 comments · May be fixed by #4000
Labels
enhancement New feature or request

Comments

@ChenX1993
Copy link
Contributor

ChenX1993 commented Apr 14, 2023

Problem Statement

Hi, really appreciate anyone who contributed to the OpenTracing Bridge.

The request is to make func (t *BridgeTracer) Extract(format interface{}, carrier interface{}) (ot.SpanContext, error) method able to support returning non-nil bridgeSpanContext when there is baggage only context without trace context.

Currently it requires trace context to be valid.

if !bridgeSC.otelSpanContext.IsValid() {
return nil, ot.ErrSpanContextNotFound
}
return bridgeSC, nil

Similar to this in Java OpenTracing Shim: open-telemetry/opentelemetry-java#4739

There are a few reasons:

  1. Inconsistent behavior in Java and Go when using the OT bridge/ shim.
  2. OTel itself supports this use case (without using the OT bridge). It makes sense to make bridge support it.

Proposed Solution

Should be a simple change like below:

if !bridgeSC.otelSpanContext.IsValid() && bridgeSC.bag.Len() == 0 {
	return nil, ot.ErrSpanContextNotFound
}

Hope this request make sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant