Platform Metrics
Platform metrics are numeric measurements collected automatically from Azure resources at regular intervals (typically every minute). You don't install agents or write code — the moment you create a resource, Azure starts recording its metrics.
What Are Platform Metrics?
Every Azure resource type exposes a set of predefined metrics. These are time-series data points: a numeric value paired with a timestamp. For example, a Virtual Machine emits "Percentage CPU = 73.2% at 10:05:00 UTC" every 60 seconds.
Platform metrics are:
- Automatic — No configuration needed
- Free — Included at no extra cost
- Retained for 93 days — Queryable via Metrics Explorer or CLI
- Near real-time — Available within 1 minute of collection
- Dimensional — Many metrics include dimensions (e.g., HTTP status code, instance name) for filtering
How They're Collected — Architecture
┌─────────────────────────────────────────────────┐
│ Azure Resource │
│ (App Service, VM, SQL, Functions, etc.) │
│ Internal telemetry emits metrics every 60s │
└──────────────────────┬──────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Azure Monitor Metrics Store │
│ • Time-series database optimized for numeric │
│ • 93-day retention │
│ • Supports dimensions for filtering │
│ • Sub-second query performance │
└──────────────────────┬──────────────────────────┘
│
┌────────────┼────────────┐
▼ ▼ ▼
Metrics Explorer Alerts REST API / CLI
(visualization) (action) (automation)
No diagnostic settings are needed for platform metrics — they flow automatically. This is different from resource logs, which require explicit routing.
Metrics Explorer Walkthrough (Portal)
- Navigate to Azure Monitor → Metrics (or open any resource → click "Metrics")
- Select scope — Pick the resource(s) you want to chart
- Select metric — Choose from the dropdown (e.g., "CPU Percentage")
- Select aggregation — Avg, Sum, Count, Min, or Max
- Adjust time range — Last hour, 24 hours, 7 days, or custom
- Add filters — Narrow by dimension (e.g., Instance = "instance_0")
- Split by dimension — Show separate lines per instance
- Pin to dashboard — Click the pin icon to save the chart
Key Metrics by Service
App Service
| Metric | What It Tells You | Alert Threshold Suggestion |
|---|---|---|
| CpuPercentage | CPU usage across all instances | > 80% sustained for 5 min |
| MemoryPercentage | Memory pressure on the plan | > 85% sustained for 5 min |
| Http5xx | Server error responses | > 10 in 5 minutes |
| HttpResponseTime | Average response latency | > 3 seconds |
| Requests | Total incoming requests | Useful for traffic baselines |
| HealthCheckStatus | Health check endpoint results | < 100% (any instance unhealthy) |
Azure Functions
| Metric | What It Tells You | Alert Threshold Suggestion |
|---|---|---|
| FunctionExecutionCount | Number of function invocations | Spike detection (> 2x baseline) |
| FunctionExecutionUnits | Compute consumption (MB-ms) | Budget-based threshold |
| Duration | Execution time per invocation | > 10 seconds (timeout risk) |
| Failures | Failed executions | > 0 (any failure worth investigating) |
| Http5xx | Server errors (HTTP-triggered) | > 5 in 5 minutes |
Service Bus
| Metric | What It Tells You | Alert Threshold Suggestion |
|---|---|---|
| ActiveMessages | Messages waiting to be processed | > 1000 (consumer falling behind) |
| DeadLetteredMessages | Messages that failed processing | > 0 (investigate immediately) |
| IncomingMessages | Messages arriving per interval | Traffic baseline |
| OutgoingMessages | Messages consumed per interval | Should track IncomingMessages |
| Size | Queue/topic size in bytes | Approaching quota |
| ServerErrors | Service-side failures | > 0 |
CLI Commands to Query Metrics
# List all available metrics for an App Service
az monitor metrics list-definitions \
--resource "/subscriptions/<sub-id>/resourceGroups/myRG/providers/Microsoft.Web/sites/myApp" \
--output table
# Get average CPU percentage for the last hour (1-minute granularity)
az monitor metrics list \
--resource "/subscriptions/<sub-id>/resourceGroups/myRG/providers/Microsoft.Web/serverFarms/myPlan" \
--metric "CpuPercentage" \
--aggregation Average \
--interval PT1M \
--start-time "2026-05-25T05:00:00Z" \
--end-time "2026-05-25T06:00:00Z"
# Get HTTP 5xx count for an App Service, summed per 5 minutes
az monitor metrics list \
--resource "/subscriptions/<sub-id>/resourceGroups/myRG/providers/Microsoft.Web/sites/myApp" \
--metric "Http5xx" \
--aggregation Total \
--interval PT5M
# Get dead-lettered messages for a Service Bus queue
az monitor metrics list \
--resource "/subscriptions/<sub-id>/resourceGroups/myRG/providers/Microsoft.ServiceBus/namespaces/myNS" \
--metric "DeadletteredMessages" \
--aggregation Average \
--interval PT1M
# Query multiple metrics at once
az monitor metrics list \
--resource "/subscriptions/<sub-id>/resourceGroups/myRG/providers/Microsoft.Web/sites/myApp" \
--metrics "Requests" "Http5xx" "AverageResponseTime" \
--aggregation Total Total Average \
--interval PT5M
Metric Aggregation Types
When you view a metric, you must choose how to aggregate raw data points within each time interval:
| Aggregation | Meaning | When to Use |
|---|---|---|
| Average | Mean of all values in the interval | CPU %, response time, memory % |
| Sum (Total) | Total of all values in the interval | Request count, error count, messages sent |
| Count | Number of data points in the interval | How many samples were collected |
| Minimum | Lowest value in the interval | Best-case latency, lowest queue depth |
| Maximum | Highest value in the interval | Peak CPU, worst-case response time |
Important: Choosing the wrong aggregation gives misleading results. Average HTTP 5xx errors will show fractions (e.g., 0.4) — use Sum instead to see actual error counts.
Creating a Metric Chart and Pinning to Dashboard
In the portal:
- Open Metrics Explorer → configure your chart (resource, metric, aggregation)
- Click the pin icon (top-right of the chart)
- Choose an existing dashboard or create a new one
- The chart updates in real-time on the dashboard
Via CLI, you can create dashboards with metric tiles using ARM/Bicep templates for infrastructure-as-code approaches.
Common Mistakes
- Using Average for count-based metrics — "Average Http5xx" across instances gives misleading decimals. Use Sum.
- Ignoring time granularity — A 1-minute interval over 30 days returns too many points. Use PT1H for longer ranges.
- Not splitting by dimension — Aggregate CPU looks fine at 60%, but one instance might be at 95%. Always check per-instance.
- Confusing App Service Plan vs App Service metrics — CPU/Memory metrics live on the Plan, not the individual app.
- Forgetting metric delays — Metrics appear within ~1 minute but not instantly. Don't panic if the latest point is missing.
Tips
- Pin your most critical metrics (CPU, errors, queue depth) to a shared dashboard for team visibility.
- Use metric alerts for real-time response; use log-based alerts for complex conditions.
- Export metrics to Log Analytics (via diagnostic settings) if you need retention beyond 93 days or want to join with logs in KQL.
- Use the "Add metric" button to overlay multiple metrics on one chart for correlation.
Key Takeaways
- Platform metrics are free, automatic, and available for every Azure resource.
- They're numeric time-series stored for 93 days in the Metrics Store.
- Use Metrics Explorer in the portal for interactive charting, or the CLI for automation.
- Choose the correct aggregation type — it fundamentally changes what the number means.
- Key metrics vary by service: CPU/Memory for compute, message counts for messaging, error rates for web apps.
- Split by dimension to catch per-instance problems hidden by averages.
- Metrics are your first line of defense; logs provide the detail for root-cause analysis.