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 theElastic.Apm.Azure.ServiceBus
namespace involve modifications to how spans are started for message actions. Specifically, theStartSpanInternal
method now includes an explicitid
parameter set toactivity.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 thediagnostic-id
andtraceparent
to the message, and proper span linking on the receiver end depends on this alignment.