AZ-104
Deep Dive
Metrics are the most frequent type of monitoring data in Azure — numeric time series that let you visualize resource state in near real time. The AZ-104 exam evaluates Metrics Explorer, per-service metrics and how to use them for autoscaling.
Contents
Metrics Explorer is Azure Monitor's graphical interface for visualizing metrics. It lets you build charts combining multiple metrics, apply dimension filters, change the time granularity and save favorite views.
Configuring a chart
Scope
Resource(s) whose metric to visualize. Can be a resource, resource group or subscription.
Metric Namespace
Category of the metric (e.g. Microsoft.Compute/virtualMachines for VMs).
Metric
The specific metric (e.g. Percentage CPU, Network In Total).
Aggregation
Avg, Max, Min, Sum, Count. How to combine data points within the granularity period.
Granularity
Time resolution: 1 min, 5 min, 15 min, 1h, 6h, 12h, 1d. Higher granularity = less detail but faster.
Filter / Split by
Filter by dimension (e.g. only Core 0) or split the chart by dimension (one line per core).
Metric retention
• 1 min granularity: available for the last 93 days
• 1 hour granularity: available for the last 93 days
• For longer retention: export to a Storage Account via Diagnostic Settings
• Platform metrics: no storage cost within the 93 days
Chart types
Line chart: time evolution. The most common.
Bar chart: comparison between periods or dimensions.
Scatter chart: correlation between two metrics.
Area chart: similar to line but with a shaded area.
Heatmap: available for certain multi-dimensional metrics.
Platform metrics are automatically collected by Azure for all resources — with no additional configuration. They represent the resource's state from Azure's point of view (not the VM's internal OS).
| Service | Key metrics | What to monitor |
|---|---|---|
| Virtual Machine | Percentage CPU, Network In/Out Total, Disk Read/Write Bytes/Operations | CPU throttling, network saturation, disk IOPS |
| Azure SQL Database | DTU consumption %, CPU %, Storage %, Failed Connections, Deadlocks | DTU saturation, failed connections (credentials or firewall), deadlocks in queries |
| App Service | Requests, Response Time, Http 5xx, CPU Percentage, Memory Percentage | 5xx errors (app bugs), high latency, App Service Plan resource saturation |
| Storage Account | Availability, Ingress, Egress, SuccessE2ELatency, Transactions | Low availability (Azure incident), high latency (bottleneck in the app) |
| Load Balancer | Byte Count, Packet Count, Health Probe Status, SNAT Connection Count | Unhealthy backends (Health Probe Status), SNAT exhaustion (outbound connections) |
| VPN Gateway | Gateway S2S Bandwidth, Tunnel Ingress/Egress Bytes, P2S Connection Count | VPN tunnel saturation, number of connected P2S users |
| Azure Kubernetes Service | Node CPU %, Node Memory %, Pod Count, Failed Pod Count | Saturated nodes, failing pods (OOM, crashloop) |
Guest OS metrics come from the VM's operating system — not the hypervisor. They include memory metrics, data disk, process and other metrics the hypervisor cannot observe. They require Azure Monitor Agent.
Windows — key guest metrics
Linux — key guest metrics
Important: memory is not in platform metrics
The platform Percentage CPU metric reflects CPU usage from the hypervisor's perspective. However, memory is NOT available as a platform metric — to monitor RAM you must install Azure Monitor Agent and configure the collection of guest OS metrics.
Custom Metrics let you publish your own metrics into Azure Monitor (e.g. number of orders processed per hour, queue size, business errors). They can be used in alerts and Metrics Explorer just like platform metrics.
Application Insights SDK
trackMetric() in the Application Insights SDK. Metrics are exposed in Azure Monitor automatically. Best option for instrumented applications.
Direct REST API
POST to the Azure Monitor Metrics API with Managed Identity authentication. For any resource that can make authenticated HTTP calls.
Azure Monitor Agent
Using Data Collection Rules with KQL transformations, you can create calculated metrics from logs. More complex but powerful.
Azure Autoscale automatically adjusts the number of instances of a resource based on metrics, a schedule, or both. Available for VMSS, App Service, AKS, and other PaaS services.
Components of an Autoscale profile
Capacity
Minimum, maximum and default number of instances.
Scale-out Rule
Condition for adding instances: e.g. CPU > 70% for 10 minutes → add 2 instances.
Scale-in Rule
Condition for removing instances: e.g. CPU < 30% for 10 minutes → remove 1 instance.
Cooldown period
Wait time between scaling actions (default 5 min scale-out, 5 min scale-in) to avoid oscillation.
Schedule (optional)
Different profile for specific days/hours. E.g. more instances during office hours.
Resources that support Autoscale
• VM Scale Sets (VMSS): scales the number of VMs
• App Service Plan: scales plan instances (not the plan tier)
• Azure Cloud Services: scales roles
• AKS: Cluster Autoscaler (different implementation)
• Application Gateway v2: native autoscaling
Autoscale exam traps
| Service | SLA | Condition | Reference metric |
|---|---|---|---|
| Single VM | 99.9% | With Premium SSD | Percentage CPU, Disk Availability |
| VM in Availability Set | 99.95% | 2+ VMs in 2+ fault domains | VM Availability, Health Status |
| VM in Availability Zones | 99.99% | 2+ VMs in 2+ distinct zones | VM Availability per zone |
| Azure SQL (Standard+) | 99.99% | All tiers except Basic | Failed Connections, DTU consumption % |
| App Service Standard+ | 99.95% | Standard tier or higher | Response Time, Http 5xx, Availability |
| Storage Account | 99.9% / 99.99% | GRS/ZRS: 99.99%, LRS: 99.9% | Availability, SuccessE2ELatency |
| VPN Gateway Zone-Redundant | 99.99% | AZ SKU (VpnGw1AZ+) | Gateway Availability, Tunnel Status |
Did you get this topic?
Test what you just learned
An administrator wants to monitor RAM usage of a Windows VM in Azure Monitor Metrics Explorer. When searching, they can't find any memory metric. Why?
Put what you learned to the test with original AZ-104 exam questions.
Start AZ-104 mock examUnlimited mock exams with the Pro plan
Log in to track your progress.