OpenTracing bridge: BridgeTracer.Inject errors with ErrInvalidCarrier #2137
Labels
bug
Something isn't working
help wanted
Extra attention is needed
pkg:bridges
Related to a bridge package
Description
We are migrating our OpenTracing app to OpenTelemetry using the OpenTracing bridge. Unfortunately
tracer.Inject
is failing withErrInvalidCarrier
despite providing a validHTTPHeaders
carrier.The code:
HTTPHeaders
hereHttpgrpcHeadersCarrier
implementsTextMapWriter
as documented onHTTPHeaders
BridgeTracer
tries to cast this carrier into a HTTPHeadersCarrier which is not possibleIs 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'sTextMapCarrier
.I see
Inject
only callsSet
so maybe we can get away with only implementing that function?Environment
Steps To Reproduce
BridgeTracer
from the OpenTracing bridgeHTTPHeaders
that implementsTextMapWriter
but is not of typeHTTPHeadersCarrier
Expected behavior
The
BridgeTracer.Inject
should accept a carrier of typeTextMapWriter
.The text was updated successfully, but these errors were encountered: