简体   繁体   中英

How to alert on queue size on azure service bus

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?

PS 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

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.

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 .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM