-
Notifications
You must be signed in to change notification settings - Fork 62
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
**DRAFT** feat: Azure Service Bus Instrumentation #2880
base: main
Are you sure you want to change the base?
Conversation
src/Agent/NewRelic/Agent/Extensions/Providers/Wrapper/AzureServiceBus/Instrumentation.xml
Show resolved
Hide resolved
.../Agent/IntegrationTests/SharedApplications/Common/MFALatestPackages/MFALatestPackages.csproj
Show resolved
Hide resolved
...NewRelic/Agent/Extensions/Providers/Wrapper/AzureServiceBus/AzureServiceBusReceiveWrapper.cs
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2880 +/- ##
==========================================
+ Coverage 81.43% 81.45% +0.02%
==========================================
Files 465 465
Lines 29573 29573
Branches 3275 3275
==========================================
+ Hits 24084 24090 +6
+ Misses 4692 4688 -4
+ Partials 797 795 -2
Flags with carried forward coverage won't be shown. Click here to find out more. |
{ | ||
"SendMessagesAsync" => MessageBrokerAction.Produce, | ||
"ScheduleMessagesAsync" => MessageBrokerAction.Produce, | ||
"CancelScheduledMessagesAsync" => MessageBrokerAction.Purge, // TODO is this correct ??? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems correct based on the description of the method.
{ | ||
protected const string BrokerVendorName = "AzureServiceBus"; | ||
|
||
public bool IsTransactionRequired => true; // only instrument service bus methods if we're already in a transaction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems different compared with other MQ that we instrument. Shouldn't the receive generate a transaction?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a topic for pairing on Tuesday. But this implementation is consistent with our MSMQ instrumentation. Unlike RabbitMQ, there's not an "eventing" layer that we could instrument that would wrap processing time on the client application.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we could potentially instrument ServiceBusProcessor
which does implement an event-based receive model where client code is called when a message is received. I'll take a quick look to see if it's worth the effort or not.
Thank you for submitting a pull request. Please review our contributing guidelines and code of conduct.
Description
This PR adds instrumentation for Azure Service Bus, for applications that use the
Azure.Messaging.ServiceBus
NuGet package, v7.12.0 and later.The following methods are instrumented:
ServiceBusReceiver
:ReceiveMessageAsync()
andReceiveMessagesAsync()
ReceiveDeferredMessageAsync()
andReceiveDeferredMessagesAsync()
PeekMessageAsync()
andPeekMessagesAsync()
CompleteMessageAsync()
AbandonMessageAsync()
DeadLetterMessageAsync()
DeferMessageAsync()
RenewMessageLockAsync()
ServiceBusSender
:SendMessageAsync()
andSendMessagesAsync()
ScheduleMessageAsync()
andScheduleMessagesAsync()
CancelScheduledMessageAsync()
andCancelScheduledMessagesAsync()
Distributed tracing support is included, using the
ApplicationProperties
dictionary.Author Checklist
Reviewer Checklist