diff --git a/tracer/src/Datadog.Trace/Propagators/W3CBaggagePropagator.cs b/tracer/src/Datadog.Trace/Propagators/W3CBaggagePropagator.cs index 635c44cb9318..2fdd09be198f 100644 --- a/tracer/src/Datadog.Trace/Propagators/W3CBaggagePropagator.cs +++ b/tracer/src/Datadog.Trace/Propagators/W3CBaggagePropagator.cs @@ -65,7 +65,7 @@ public void Inject( { var baggage = context.Baggage; - if (baggage?.Items is null or { IsEmpty: true }) + if (baggage is null or { Count: 0 }) { // nothing to inject return; @@ -113,7 +113,7 @@ public bool TryExtract( context = new PropagationContext(spanContext: null, baggage); TelemetryFactory.Metrics.RecordCountContextHeaderStyleExtracted(MetricTags.ContextHeaderStyle.Baggage); - return baggage is { IsEmpty: false }; + return baggage is { Count: > 0 }; } internal static string Encode(string value, HashSet charsToEncode) @@ -162,7 +162,7 @@ internal static string CreateHeader( int maxBaggageItems, int maxBaggageLength) { - if (baggage is null or { IsEmpty: true }) + if (baggage is null or { Count: 0 }) { return string.Empty; }