Monitoring & Azure Monitor

💤0
Lv 10 XP
← ☁️ Microsoft Azure · AZ-104 Administration

Monitoring & Azure Monitor

Intermediate ⭐ 80 XP ⏱ 16 min #azure#az-104#monitoring

Collect metrics and logs, query with KQL, and alert with Azure Monitor.

📖Theory

Azure Monitor is the umbrella for observability. It collects two data types:

  • Metrics — numeric time-series (CPU, memory), near real-time, in Metrics Explorer
  • Logs — structured events sent to a Log Analytics workspace, queried with KQL (Kusto Query Language)

On top, Alerts fire on metric thresholds or log queries and trigger action groups (email, webhook, runbook). Application Insights adds app-level telemetry (requests, dependencies, traces). Workbooks and dashboards visualize it all.

🌍Real-World Example
// KQL: top 10 slow requests in the last hour
requests
| where timestamp > ago(1h)
| where duration > 1000
| project timestamp, name, duration, resultCode
| order by duration desc
| take 10
Alert: "CPU > 80% for 5 minutes on vm-web"
  → Action group: email on-call + trigger an automation runbook
✍️Hands-On Exercise
  1. Distinguish a scenario best served by metrics vs by logs.
  2. Write a plain-English alert rule for high memory usage.
  3. Sketch a KQL query that counts errors per service over a day.
  4. Explain what an action group does when an alert fires.
🧾Cheat Sheet
ComponentPurpose
MetricsNumeric time-series, fast
Log AnalyticsStores logs, queried with KQL
KQLKusto query language
AlertsFire on metric/log conditions
Action groupsNotify/automate on alert
Application InsightsApp telemetry + traces
💬Common Interview Questions
What's the difference between metrics and logs in Azure Monitor?

Metrics are lightweight numeric time-series ideal for fast alerting; logs are rich structured events stored in Log Analytics and queried with KQL for deep analysis.

What is an action group?

A reusable set of notifications and actions (email, SMS, webhook, runbook, Logic App) that an alert triggers when its condition is met.

📚Official Documentation

📝 My notes on this topic

Auto-saves as you type