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

Faulty Warning in Opentracing Shim #2978

Closed
Jarch09 opened this issue Jun 25, 2022 · 1 comment · Fixed by #3029
Closed

Faulty Warning in Opentracing Shim #2978

Jarch09 opened this issue Jun 25, 2022 · 1 comment · Fixed by #3029
Labels
bug Something isn't working

Comments

@Jarch09
Copy link

Jarch09 commented Jun 25, 2022

Description

Currently, the opentracing shim is issuing a warning (SDK should have deferred the context setup, see the documentation of go.opentelemetry.io/otel/bridge/opentracing/migration) even if everything is being done correctly.

Steps To Reproduce

  1. BridgeTracer.StartSpan calls WrapperTracer.Start: https://github.com/open-telemetry/opentelemetry-go/blob/main/bridge/opentracing/bridge.go#L429
  2. WrapperTracer.Start calls the underlying opentelemetry tracer.Start: https://github.com/open-telemetry/opentelemetry-go/blob/main/bridge/opentracing/wrapper.go#L79 ... among other effects, this adds the opentelemetry span to the context
  3. Therefore, even if we successfully SkipContextSetup, we have a new context object
  4. Therefore, the context comparison in BridgeTracer.StartSpan always fails even if we've "set up everything correctly" - this results in the warning: SDK should have deferred the context setup, see the documentation of go.opentelemetry.io/otel/bridge/opentracing/migration (link)

Expected behavior

I think this check / warning is meant to verify that the opentracing span hasn't been added to the context yet.

If this is the intent, we could check to see if the opentracing span is in the context:

if ot.SpanFromContext(checkCtx2) != nil {
    // issue warning
}

@Jarch09 Jarch09 added the bug Something isn't working label Jun 25, 2022
@dmathieu dmathieu linked a pull request Jul 19, 2022 that will close this issue
@dmathieu
Copy link
Member

Thank you for reporting this. I have opened a fix in #3029.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants