Skip to main content
APA
Sponsored byCAST AI — Kubernetes cost optimizationBetter Stack — Uptime monitoring and log managementVictoriaMetrics — Fast, open-source time series database and drop-in Prometheus replacement.

Azure logoAzure Prometheus Alert Rules

3 Prometheus alerting rules for Azure.Exported via webdevops/azure-metrics-exporter.These rules cover critical and warning conditions — copy and paste the YAML into your Prometheus configuration.

⚠️

Alert thresholds depend on the nature of your applications. Some queries may have arbitrary tolerance thresholds. Building an efficient monitoring platform takes time. 😉

The exporter uses azurerm_resource_metric as the default metric name for forwarded Azure Monitor metrics.
The metric name can be customized via the name parameter in probe configuration.
Self-monitoring metrics use the azurerm_stats_* and azurerm_api_* prefixes.
wget https://raw.githubusercontent.com/samber/awesome-prometheus-alerts/refs/heads/master/dist/rules/azure/azure-metrics-exporter.yml
warning

11.4.1.Azure API read rate limit approaching

Azure API read rate limit for subscription {{ $labels.subscriptionID }} is running low ({{ $value }} remaining).

  # Azure Resource Manager enforces rate limits per subscription.
  # The threshold of 100 remaining calls is a rough default. Adjust based on your
  # scrape interval and number of monitored resources.
- alert: AzureApiReadRateLimitApproaching
  expr: 'azurerm_api_ratelimit{type="reads"} < 100'
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: Azure API read rate limit approaching (instance {{ $labels.instance }})
    description: "Azure API read rate limit for subscription {{ $labels.subscriptionID }} is running low ({{ $value }} remaining).\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

11.4.2.Azure API write rate limit approaching

Azure API write rate limit for subscription {{ $labels.subscriptionID }} is running low ({{ $value }} remaining).

  # 50 remaining is a rough default; depends on your Azure subscription's configured API write quota and your call volume — adjust based on your baseline.
- alert: AzureApiWriteRateLimitApproaching
  expr: 'azurerm_api_ratelimit{type="writes"} < 50'
  for: 0m
  labels:
    severity: warning
  annotations:
    summary: Azure API write rate limit approaching (instance {{ $labels.instance }})
    description: "Azure API write rate limit for subscription {{ $labels.subscriptionID }} is running low ({{ $value }} remaining).\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
warning

11.4.3.Azure exporter slow collection

Azure metrics exporter on {{ $labels.instance }} average completed metric collection time over the last 15 minutes is above 5 minutes ({{ $value }}s).

  # 5-minute threshold is a rough default; collection time scales with how many Azure resources and metrics you're monitoring — adjust based on your monitored fleet size.
  # The Summary records completed collections; this average does not measure an in-flight collection.
  # The 15-minute window must exceed the probe interval. Increase it for less frequent probes.
- alert: AzureExporterSlowCollection
  expr: 'rate(azurerm_stats_metric_collecttime_sum[15m]) / rate(azurerm_stats_metric_collecttime_count[15m]) > 300'
  for: 5m
  labels:
    severity: warning
  annotations:
    summary: Azure exporter slow collection (instance {{ $labels.instance }})
    description: "Azure metrics exporter on {{ $labels.instance }} average completed metric collection time over the last 15 minutes is above 5 minutes ({{ $value }}s).\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"