Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix span linking for Azure ServiceBus #2474

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevejgordon
Copy link
Contributor

Align span ID with activity's span ID in ServiceBus listener

The code changes in the AzureMessagingServiceBusDiagnosticListener.cs file within the Elastic.Apm.Azure.ServiceBus namespace involve modifications to how spans are started for message actions. Specifically, the StartSpanInternal method now includes an explicit id parameter set to activity.SpanId.ToString(). This change ensures that the span ID matches the activity's span ID, which is crucial for correctly linking the consuming span to the producer. This adjustment is necessary because the Azure SDK automatically attaches the diagnostic-id and traceparent to the message, and proper span linking on the receiver end depends on this alignment.

Align span ID with activity's span ID in ServiceBus listener

The code changes in the `AzureMessagingServiceBusDiagnosticListener.cs`
file within the `Elastic.Apm.Azure.ServiceBus` namespace involve
modifications to how spans are started for message actions. Specifically,
the `StartSpanInternal` method now includes an explicit `id` parameter
set to `activity.SpanId.ToString()`. This change ensures that the span ID
matches the activity's span ID, which is crucial for correctly linking
the consuming span to the producer. This adjustment is necessary because
the Azure SDK automatically attaches the `diagnostic-id` and `traceparent`
to the message, and proper span linking on the receiver end depends on
this alignment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant