D5 · Monitoring

Metrics and KPIs

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.

Metrics Explorer

Metrics Explorer is '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

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).

ServiceKey metricsWhat to monitor
Virtual MachinePercentage CPU, Network In/Out Total, Disk Read/Write Bytes/OperationsCPU throttling, network saturation, disk IOPS
Azure SQL DatabaseDTU consumption %, CPU %, Storage %, Failed Connections, DeadlocksDTU saturation, failed connections (credentials or firewall), deadlocks in queries
App ServiceRequests, Response Time, Http 5xx, CPU Percentage, Memory Percentage5xx errors (app bugs), high latency, App Service Plan resource saturation
Storage AccountAvailability, Ingress, Egress, SuccessE2ELatency, TransactionsLow availability (Azure incident), high latency (bottleneck in the app)
Load BalancerByte Count, Packet Count, Health Probe Status, SNAT Connection CountUnhealthy backends (Health Probe Status), SNAT exhaustion (outbound connections)
Gateway S2S Bandwidth, Tunnel Ingress/Egress Bytes, P2S Connection CountVPN tunnel saturation, number of connected P2S users
Azure Kubernetes ServiceNode CPU %, Node Memory %, Pod Count, Failed Pod CountSaturated nodes, failing pods (OOM, crashloop)

Guest OS metrics

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

  • •Memory\Available Bytes — available RAM (the platform can't see the OS's memory)
  • •LogicalDisk\% Free Space — free space per logical disk
  • •LogicalDisk\Disk Reads/Writes per sec — IOPS per partition
  • •Process\% Processor Time — CPU per process
  • •System\Processor Queue Length — scheduler queue

Linux — key guest metrics

  • •mem\MemAvailable — available RAM
  • •disk\Free — free space per mount point
  • •disk\reads/writes per second — IOPS per disk
  • •process\pctUsedMemory — memory usage per process
  • •netstatistics\tx/rx bytes — network traffic

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

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.

Metric-based autoscale

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

  • → Autoscale doesn't scale individual VM instances (only the number of VMs in a VMSS)
  • → The cooldown period prevents frantic scaling — if it scales at 12:00, it can't scale again until 12:05 (default)
  • → You always need both scale-out AND scale-in rules — without scale-in, instances never shrink
  • → Minimum capacity: even if CPU is at 0%, it won't go below this number

KPIs and by service

ServiceSLAConditionReference metric
Single VM99.9%With Premium SSDPercentage CPU, Disk Availability
VM in Availability Set99.95%2+ VMs in 2+ fault domainsVM Availability, Health Status
VM in Availability Zones99.99%2+ VMs in 2+ distinct zonesVM Availability per zone
Azure SQL (Standard+)99.99%All tiers except BasicFailed Connections, DTU consumption %
App Service Standard+99.95%Standard tier or higherResponse Time, Http 5xx, Availability
Storage Account99.9% / 99.99%GRS/ZRS: 99.99%, LRS: 99.9%Availability, SuccessE2ELatency
VPN Gateway Zone-Redundant99.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?

Ready to test "Metrics and KPIs"?

Put what you learned to the test with original AZ-104 exam questions.

Start AZ-104 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.