Skip to content

Commit

Permalink
W3CBaggagePropagator
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspimentel committed Oct 23, 2024
1 parent e887c73 commit 909841c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tracer/src/Datadog.Trace/Propagators/W3CBaggagePropagator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void Inject<TCarrier, TCarrierSetter>(
{
var baggage = context.Baggage;

if (baggage?.Items is null or { IsEmpty: true })
if (baggage is null or { Count: 0 })
{
// nothing to inject
return;
Expand Down Expand Up @@ -113,7 +113,7 @@ public bool TryExtract<TCarrier, TCarrierGetter>(
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<char> charsToEncode)
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 909841c

Please sign in to comment.