Azure / azure-functions-servicebus-extension

Service Bus extension for Azure Functions
MIT License
65 stars 36 forks source link

Emit ServiceBus SDK logs to help diagnose issues #168

Closed sidkri closed 2 years ago

sidkri commented 3 years ago

We have come across an infrequent issue where the service bus client (either the extension of the Service Bus SDK) is acquiring and then abandoning messages in rapid succession (within milliseconds) with no errors emitted in the logs. The Service Bus Extension does register an exception handler with the Service Bus SDK and logs when invoked but these logs do not show up when the issue occurs so we need to see if there is an exception in the Service Bus SDK layer that does not invoke the handler. This can be done by creating an EventListener class listening to Microsoft.Azure.ServiceBus.MessagingEventSource:

EventListener Class (System.Diagnostics.Tracing) | Microsoft Docs

cachai2 commented 2 years ago

https://github.com/Azure/azure-functions-servicebus-extension/pull/170

cachai2 commented 2 years ago

This is supported in the 5.x+ version of the Service Bus sdks and is enabled by default. For info on using this version, refer here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus#service-bus-extension-5x-and-higher.

alrod commented 2 years ago

This is done in track2 (5.x). Also you can use the filtering: https://github.com/Azure/azure-sdk-for-net/issues/25865#issuecomment-992067772