6
votes

I have a premium service bus in Azure with a number of Queues. I can set max size for these, but I can't seem to find a way to alert the support team, via any route, but I would prefer email, if these queues exceed 1,000 messages in length, ie our consumers have fallen over or are not processing fast enough.

How can I set up some form of alerting for queue length on Azure service bus?

P.S. we still seem to be waiting for it to be implemented as a first class feature: https://feedback.azure.com/forums/231545-diagnostics-and-monitoring/suggestions/4486464-alerts-based-on-queue-size

3
If something is under a review from February 2014, then most likely it's dead or will not materialize.Sean Feldman
If you're open to 3rd party services, look into CloudMonix that does an amazing job at monitoring Azure Service Bus Queues & Topics for counts, deadletters, etc -- cloudmonix.comIgorek
If you are considering 3rd party software, give Serverless360 a try which has capabilities to monitor and send alerts. It is easy to configure - serverless360.comBalasubramaniam

3 Answers

3
votes

Traditionally, a solution was indeed to pull message counts using NamespaceManager and report that value periodically. While it's an approach that works, there's another alternative that is emerging these days - Azure Monitor Service.

With this approach, unlike polling for data, Azure Service Bus is reporting to Monitor the metrics. Those metrics can be queried or alerts be created sending notifications to email addresses, webhook, or LogicApp. It's still fresh and in preview, but is shaping up nicely. For Azure Service Bus specifically, you can already get the metrics for a namespace and entity specific information should be available in a foreseeable future.

Update

I've raised an issue for Azure Service Bus you can track to see when it's available.

2
votes

I haven't heard of out-of-the-box solution which does not involve custom code or 3rd party service.

IMO, what often happens is that the company has a tool to monitor all operational metrics of their IT landscape, and also do alerts. Depending on the tool, there might be varying levels of Azure Services monitoring support.

If you don't have such tool, or your tool doesn't integrate with Service Bus, one approach is to create an Azure Function (or multiple functions) to retrieve statistics from Service Bus queues, and then integrate it with an alert-enabled tool.

The suggestion forum from your question has a link to such integration to Azure Application Insights. We use PRTG for monitoring and alerting, so we integrated PRTG to Azure Functions.

1
votes

Azure portal provides the facility to trigger alert when an entity exceeds a threshold value. You can use monitoring in Azure portal to achieve this. Note that this feature is in preview stage currently.