Skip to content

Commit

Permalink
code reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
simaoribeiro committed Oct 13, 2023
1 parent ea13246 commit ba50742
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public static Task OnProducerStarted(IMessageContext context)
// https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/messaging.md
var activity = ActivitySourceAccessor.ActivitySource.StartActivity(activityName, ActivityKind.Producer);

context?.Items.Add(ActivitySourceAccessor.ActivityString, activity);

// Depending on Sampling (and whether a listener is registered or not), the
// activity above may not be created.
// If it is created, then propagate its context.
Expand All @@ -36,6 +34,8 @@ public static Task OnProducerStarted(IMessageContext context)

if (activity != null)
{
context?.Items.Add(ActivitySourceAccessor.ActivityString, activity);

contextToInject = activity.Context;
}
else if (Activity.Current != null)
Expand Down

0 comments on commit ba50742

Please sign in to comment.