Monitor Azure Cache for Redis

Effective monitoring helps you ensure high performance, reliability, and cost‑efficiency of your Redis cache instances. This guide covers built‑in metrics, alerting, diagnostics, and integration with Azure Monitor.

Overview
Metrics
Alerts
Diagnostics
Best Practices

Why Monitor?

All Redis caches publish metrics to Azure Monitor automatically. Use the Azure portal, Azure CLI, PowerShell, or REST API to access them.

Key Metrics

MetricDescriptionUnit
CacheHitsNumber of successful GET commands.Count
CacheMissesGET commands that returned nil.Count
CacheKeysCurrent number of keys stored.Count
CacheEvictionsKeys removed due to memory pressure.Count
ServerLoadCPU usage of the Redis server.Percentage
ConnectedClientsNumber of client connections.Count
UsedMemoryTotal memory allocated.Bytes
CacheOperationsPerSecondTotal commands processed per second.Count/sec

To view these metrics in the portal, navigate to Monitoring → Metrics on your cache resource.

Setting Up Alerts

Create alert rules to be notified when a metric exceeds a threshold.

  1. Open your Redis cache resource.
  2. Select Alerts → New alert rule.
  3. Choose a metric (e.g., CacheEvictions).
  4. Define the condition (e.g., > 100 evictions in 5 minutes).
  5. Configure an action group to send email, SMS, or webhook.
  6. Save the rule.

Example JSON for a REST API alert rule:

{
  "location": "global",
  "tags": {},
  "properties": {
    "description": "High eviction rate",
    "severity": 2,
    "enabled": true,
    "condition": {
      "metricName": "CacheEvictions",
      "operator": "GreaterThan",
      "threshold": 100,
      "timeAggregation": "Total",
      "windowSize": "PT5M"
    },
    "actions": [
      {
        "actionGroupId": "/subscriptions/xxxx/resourceGroups/rg/providers/microsoft.insights/actionGroups/ag"
      }
    ]
  }
}

Diagnostics Logs

Enable diagnostics to stream detailed Redis logs to Log Analytics, Event Hubs, or a Storage account.

Steps:

  1. Go to Monitoring → Diagnostic settings.
  2. Click + Add diagnostic setting.
  3. Select the logs you need and the destination (Log Analytics workspace recommended).
  4. Save.

Query example (Log Analytics):

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.REDIS"
| where Category == "SlowLog"
| summarize count() by bin(TimeGenerated, 5m)

Monitoring Best Practices