You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-11-25 22:41:46 +02:00
Simplify trace_context tests (#2108)
* Simplify trace_context tests Refactor the propagation/trace_context tests to be targeted at testing the propagator functionality only and remove extraneous dependencies. Fix the TraceContext Inject method from injecting the tracestate header if no value exists. * Add changes to changelog
This commit is contained in:
@@ -50,7 +50,9 @@ func (tc TraceContext) Inject(ctx context.Context, carrier TextMapCarrier) {
|
||||
return
|
||||
}
|
||||
|
||||
carrier.Set(tracestateHeader, sc.TraceState().String())
|
||||
if ts := sc.TraceState().String(); ts != "" {
|
||||
carrier.Set(tracestateHeader, ts)
|
||||
}
|
||||
|
||||
// Clear all flags other than the trace-context supported sampling bit.
|
||||
flags := sc.TraceFlags() & trace.FlagsSampled
|
||||
|
||||
Reference in New Issue
Block a user