From 909841cb64b6eb65f6b6767640c5cc3840152953 Mon Sep 17 00:00:00 2001 From: Lucas Pimentel Date: Wed, 23 Oct 2024 12:47:57 -0400 Subject: [PATCH] W3CBaggagePropagator --- .../src/Datadog.Trace/Propagators/W3CBaggagePropagator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }