Atatus .NET APM traces Azure Service Bus operations by subscribing to diagnostics from the SDKs, creating transactions for message receipt and spans for send and schedule operations.
Package installation
Add the Atatus Service Bus instrumentation package to the application.
dotnet add package Atatus.Azure.ServiceBus --version 3.2.2
If you are already using the Atatus.Apm.NetCoreAll package, Service Bus subscribers are wired automatically and no additional subscription code is required.
Subscribe to Service Bus diagnostics
Depending on the Service Bus client in use, register the matching diagnostics subscriber during application startup so Atatus can create the right transactions and spans from emitted activities. Azure Service Bus clients publish tracing via System.Diagnostics Activity/DiagnosticSource primitives. Depending on the SDK used, subscribe the corresponding diagnostics subscriber to the agent:
using Atatus;
using Atatus.Azure.ServiceBus;
// For Microsoft.Azure.ServiceBus
Agent.Subscribe(new MicrosoftAzureServiceBusDiagnosticsSubscriber());
// For Azure.Messaging.ServiceBus
Agent.Subscribe(new AzureMessagingServiceBusDiagnosticsSubscriber());
What Atatus captures ?
Creates a transaction when:
- Messages are received from a queue or topic subscription.
- A deferred message is received.
Creates a span (inside an active transaction) when:
- Messages are sent to a queue or topic.
- Messages are scheduled to a queue or topic.
+1-415-800-4104