Azure Storage Queues Metrics

Understanding the performance and health of your Azure Storage Queues is crucial for maintaining reliable applications. Azure Monitor provides a comprehensive set of metrics that allow you to track various aspects of your queue operations.

Key Queue Metrics

The following are some of the most important metrics to monitor for Azure Storage Queues:

Metric Name Description Aggregation Type
Messages in Queue The number of messages currently in the queue. A consistently high number might indicate that your consumers are not processing messages fast enough. Average, Maximum
Ingress The total ingress (in bytes) to the storage account. This metric helps you understand the volume of data being written to your queues. Total, Average
Egress The total egress (in bytes) from the storage account. This metric tracks the volume of data being read from your queues. Total, Average
Success Server Latency The latency of successful requests to the queue service. High latency can indicate performance bottlenecks. Average, Maximum
Total Server Latency The latency of all requests (successful or failed) to the queue service. Average, Maximum
Average Time to Serve Request The average time taken to serve a request. Average
Dequeue Count The number of messages that have been dequeued. This helps track message processing volume. Total, Average
Message Count The number of messages in the queue. Average, Maximum
Peak Queue Depth The maximum number of messages observed in the queue over a period. Maximum

Accessing Queue Metrics with Azure Monitor

Azure Monitor provides a unified portal for viewing all your Azure resource metrics. You can access queue metrics through the Azure portal by navigating to your Storage Account and then selecting the "Monitoring" section.

Steps to view metrics:

  1. Sign in to the Azure portal.
  2. Navigate to your Storage Account resource.
  3. In the left-hand menu, under the "Monitoring" section, select "Metrics".
  4. In the Metrics pane, select "Queue" from the "Metric Namespace" dropdown.
  5. Choose the specific metric you want to visualize (e.g., "Messages in Queue").
  6. Select the desired time range and granularity.
  7. You can also "Pin" charts to your Azure dashboard for quick access.

Setting Up Alerts

To proactively manage your queue's performance and health, you can set up alerts based on these metrics. For instance, you can create an alert that triggers when the "Messages in Queue" count exceeds a predefined threshold for a certain duration.

Tip: Regularly reviewing queue metrics and setting up appropriate alerts can help you identify and resolve potential issues before they impact your application's users.

Example Metric Query (Azure CLI)

You can also query metrics programmatically using Azure CLI:


az monitor metrics list --resource "YOUR_STORAGE_ACCOUNT_RESOURCE_ID" \
  --metric "MessagesInQueue" \
  --interval PT5M \
  --aggregation Average \
  --start-time "2023-10-27T10:00:00Z" \
  --end-time "2023-10-27T11:00:00Z"
                

Replace YOUR_STORAGE_ACCOUNT_RESOURCE_ID with the actual resource ID of your storage account.

Further Reading