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: BridgeTracer.Inject errors with ErrInvalidCarrier #2137

Open
yvrhdn opened this issue Jul 28, 2021 · 1 comment
Open
Labels
bug Something isn't working help wanted Extra attention is needed pkg:bridges Related to a bridge package

Comments

@yvrhdn
Copy link
Contributor

yvrhdn commented Jul 28, 2021

Description

We are migrating our OpenTracing app to OpenTelemetry using the OpenTracing bridge. Unfortunately tracer.Inject is failing with ErrInvalidCarrier despite providing a valid HTTPHeaders carrier.

The code:

Is this a known limitation of the OpenTracing bridge?

I'd guess to solve this we'd need some kind of adapter from the OpenTracing TextMapWriter into OTel's TextMapCarrier.
I see Inject only calls Set so maybe we can get away with only implementing that function?

Environment

  • opentelemetry-go version: v1.0.0-RC2
  • github.com/opentracing/opentracing-go: v1.2.0

Steps To Reproduce

  1. Use BridgeTracer from the OpenTracing bridge
  2. Inject a carrier with format HTTPHeaders that implements TextMapWriter but is not of type HTTPHeadersCarrier

Expected behavior

The BridgeTracer.Inject should accept a carrier of type TextMapWriter.

@yvrhdn yvrhdn added the bug Something isn't working label Jul 28, 2021
@bboreham
Copy link
Contributor

I started working on this.

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: High priority
Development

Successfully merging a pull request may close this issue.

3 participants