Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaspimentel committed Oct 11, 2024
1 parent 9d57071 commit 6b5fc0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tracer/src/Datadog.Trace/SpanContextExtractor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ internal SpanContextExtractor(bool unusedParamNotToUsePublicApi)
if (messageType != null && source == null) { ThrowHelper.ThrowArgumentNullException(nameof(source)); }
else if (messageType == null && source != null) { ThrowHelper.ThrowArgumentNullException(nameof(messageType)); }

var spanContext = SpanContextPropagator.Instance.Extract(carrier, getter);
var context = SpanContextPropagator.Instance.Extract(carrier, getter);
var spanContext = context.SpanContext;

if (spanContext is not null
&& Tracer.Instance.TracerManager.DataStreamsManager is { IsEnabled: true } dsm)
Expand Down
6 changes: 5 additions & 1 deletion tracer/src/Datadog.Trace/SpanContextInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ internal static void InjectInternal<TCarrier>(TCarrier carrier, Action<TCarrier,

if (context is SpanContext spanContext)
{
SpanContextPropagator.Instance.Inject(spanContext, carrier, setter);
// TODO: should this silently inject Baggage.Current?
SpanContextPropagator.Instance.Inject(
new PropagationContext(spanContext, baggage: null),
carrier,
setter);

if (string.IsNullOrEmpty(messageType) || string.IsNullOrEmpty(target))
{
Expand Down

0 comments on commit 6b5fc0d

Please sign in to comment.