Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

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

like image 273
Mr_road Avatar asked Dec 05 '17 15:12

Mr_road


People also ask

How do I monitor my Azure Service Bus queue?

You can access alerts for Azure Service Bus by selecting Alerts from the Azure Monitor section on the home page for your Service Bus namespace. See Create, view, and manage metric alerts using Azure Monitor for details on creating alerts.

What is the maximum size of a message in an Azure Service Bus queue?

Service Bus messaging services (queues and topics/subscriptions) allow application to send messages of size up to 256 KB (standard tier) or 100 MB (premium tier).

What happens when Service Bus queue max delivery count exceeds?

When the delivery count exceeds the limit, the message is moved to the DLQ. The dead-letter reason for the message in DLQ is set to: MaxDeliveryCountExceeded. This behavior can't be disabled, but you can set the max delivery count to a large number.

What would be the size of an individual messages in Azure queue storage service?

A queue message can be up to 64 KB in size. A queue may contain millions of messages, up to the total capacity limit of a storage account.


1 Answers

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.

like image 107
Sean Feldman Avatar answered Oct 05 '22 01:10

Sean Feldman