opentelemetry-go
opentelemetry-go copied to clipboard
OpenTracing Bridge: allow more generic carriers
Instead of insisting that the carrier is an HTTPHeaders
, cast it or adapt it to the interface we need - TextMapCarrier
.
~It's a bit long-winded to wrap the read and write side separately, but this gives maximum flexibility.~
Fixes #2137 - @kvrhdn has used this fork to create a working program.
Codecov Report
Merging #2141 (8c48780) into main (1884de2) will increase coverage by
0.2%
. The diff coverage is78.7%
.
@@ Coverage Diff @@
## main #2141 +/- ##
=======================================
+ Coverage 75.7% 75.9% +0.2%
=======================================
Files 178 178
Lines 11703 11740 +37
=======================================
+ Hits 8864 8922 +58
+ Misses 2614 2584 -30
- Partials 225 234 +9
Impacted Files | Coverage Δ | |
---|---|---|
bridge/opentracing/bridge.go | 53.1% <78.7%> (+9.5%) |
:arrow_up: |
sdk/trace/batch_span_processor.go | 80.2% <0.0%> (-1.0%) |
:arrow_down: |
exporters/jaeger/jaeger.go | 91.1% <0.0%> (+0.8%) |
:arrow_up: |
I can confirm this fixes our issue, propagation context can be injected and extracted without error now 🙂
Ping @bboreham. Rebase needed and some feedback to look at.
Ack. It hasn't been high enough up my priority list lately.
Rebased and added unit tests for the Inject/Extract functionality added in this PR.
Note that ot.HTTPHeadersCarrier
needs special treatment - Set()
modifies the keys to meet HTTP header expectations - so we can't use the generic wrapper I added in that case.
It appears baggage was never propagated by BridgeTracer
, so that is not included in the test.
Does https://github.com/open-telemetry/opentelemetry-go/pull/2911 meet the needs here, or is there more required?
Does https://github.com/open-telemetry/opentelemetry-go/pull/2911 meet the needs here
Strictly no, however I think #2911 makes it easier to work around the deficiency.
~Perhaps you will update the doc says it should work with TextMapWriter
?~
EDIT that doc is in OpenTracing so I realise OpenTelemetry would not update it.
Do you have any response to https://github.com/open-telemetry/opentelemetry-go/pull/2141#issuecomment-1101314799 ?
@MrAlias Do you have any further feedback for this PR please?