Instrumentation strategy

AZ-400 notes, 5–10% of the exam, updated November 2026

Instrumentation is the smallest domain (5-10%), but the questions are very concrete. They ask which Azure Monitor feature collects what, which alert type fits, how to wire an alert to Teams or a pipeline, and to read or complete a KQL query. Keep the vocabulary straight and practise the basic KQL operators.

Azure Monitor overview

Azure Monitor collects, analyses and acts on telemetry from Azure, on-premises and other clouds.

Data type Stored in Examples
Metrics Azure Monitor metrics store (time-series, lightweight, near real time, 93 days of retention) CPU percentage, request count, queue length
Logs Log Analytics workspace (queried with KQL, retention configurable) Activity log, resource logs, Application Insights telemetry, custom logs
Traces Application Insights (distributed tracing) Requests, dependencies, operation IDs
Changes Change Analysis What changed before an incident

Key components:

  • Log Analytics workspace: the log store and query engine. One workspace can be shared by many resources. Use resource-context or workspace-context RBAC, plus table-level access and retention per table. Tables can use Analytics (full query), Basic (cheap, limited query, short interactive retention) or Auxiliary plans for high-volume data.
  • Diagnostic settings: per-resource setting that sends resource logs and platform metrics to a Log Analytics workspace, a storage account (archive), an event hub (stream to SIEM) or a partner. Activity log (control-plane operations, subscription level) needs a diagnostic setting to be kept beyond 90 days.
  • Data collection rules (DCRs) and the Azure Monitor Agent (AMA): AMA replaces the Log Analytics agent (MMA) and the diagnostics extension; a DCR defines what to collect from which machines and where to send it, with transformations to filter and reshape data. Machines are associated with DCRs (data collection rule associations). On non-Azure machines install AMA through Azure Arc.
  • Insights: curated monitoring experiences (Application Insights, VM insights, Container insights, Storage insights, Network insights).
  • Workbooks, dashboards, Grafana (Azure Managed Grafana) and Power BI for visualisation.
  • Alerts, action groups, autoscale for response.

Integrating Azure Monitor with DevOps tools

  • Azure Pipelines: the Query Azure Monitor alerts check/gate blocks or fails a deployment if alerts are firing on the target, enabling safe deployment with automatic rollback. Release annotations in Application Insights mark deployments on charts (the Release Annotation task or az monitor app-insights / REST).
  • Send pipeline telemetry to Log Analytics: use Azure DevOps auditing streams (to Azure Monitor logs, Event Hubs, Splunk) and the Log Analytics HTTP data collector or Logs Ingestion API from a pipeline step. GitHub audit log streaming goes to Azure Event Hubs, Azure Blob Storage, Splunk and Datadog.
  • Action groups invoke Azure Functions, Logic Apps, webhooks, Automation runbooks, ITSM, Event Hub, email/SMS/push/voice. A webhook to Azure Pipelines or GitHub repository_dispatch can start a remediation pipeline.
  • Azure Boards / GitHub Issues: an alert can create a work item through a Logic App or webhook, so incidents get tracked. In Application Insights, work item integration creates Azure DevOps work items from a telemetry item (Work Item Integration setting on the resource).
  • Teams / Slack / PagerDuty: through action groups (Logic Apps, webhooks) or the Azure Monitor connector.
  • Microsoft Sentinel reads Azure DevOps and GitHub audit logs for security analytics.

Application Insights

Application Insights is the application performance management (APM) feature of Azure Monitor. All new resources are workspace-based: the data is stored in a Log Analytics workspace (classic standalone resources were retired).

What it collects

Telemetry Meaning
Requests Incoming requests, duration, result code, success
Dependencies Outgoing calls (SQL, HTTP, storage) with duration and success
Exceptions Handled and unhandled errors with stack traces
Traces Log messages
Page views and browser timings Client-side usage from the JavaScript SDK
Custom events and metrics TrackEvent, TrackMetric for business telemetry
Availability results From availability tests

Enabling it

  • Autoinstrumentation (codeless): toggle on App Service, Functions, VMs, AKS (some languages), Container Apps. No code changes. Limited customisation.
  • Azure Monitor OpenTelemetry Distro: the recommended SDK path for .NET, Java, Node.js and Python (UseAzureMonitor(), and the Java agent). Set the connection string (APPLICATIONINSIGHTS_CONNECTION_STRING), not the old instrumentation key alone.
  • Classic Application Insights SDKs are being superseded by OpenTelemetry.
  • JavaScript SDK (client-side) for browser telemetry.
  • Sampling reduces volume and cost: adaptive (default in the .NET SDK), fixed rate and ingestion sampling. Telemetry stays correlated within a sampled operation.

Features to know

Feature Use
Live Metrics Real-time view with about one-second latency, useful during a deployment; no data stored
Application Map Topology of components and dependencies with health and call rates; shows where failures originate
Transaction search / end-to-end transaction view Follow one request through components
Failures and Performance blades Top failing operations/dependencies, slowest operations with percentiles
Smart detection Automatic anomaly detection (failure anomalies, performance degradation, memory leak) with email notice
Availability tests Standard (URL ping with SSL and headers, multi-region) and custom TrackAvailability tests; the older URL ping and multi-step web tests are retired
Usage analysis Users, sessions, events, funnels, retention, user flows, cohorts, workbooks
Profiler and Snapshot Debugger Code-level performance traces and production exception snapshots
Metrics explorer Chart standard and log-based metrics, pin to dashboards
Alerts Metric alerts, log alerts, availability alerts, smart detection rules
Release annotations Mark deployments on charts to correlate changes with behaviour

Distributed tracing

A distributed trace follows one request across services. Each unit of work is a span, linked by an operation ID (trace ID) and parent IDs. Application Insights correlates requests, dependencies and exceptions across services using the W3C Trace Context standard (traceparent header), and the Application Map, transaction diagnostics (end-to-end transaction view, showing a Gantt of calls and timings) and Logs (requests, dependencies, exceptions tables joined on operation_Id) let you inspect it.

Requirements for good tracing: every service instrumented with the same OpenTelemetry/Application Insights setup, context propagated across HTTP and messaging, and a consistent cloud role name (cloud_RoleName) so services show as distinct nodes on the map. In KQL, an operation ID joins across tables:

union requests, dependencies, exceptions, traces
| where operation_Id == "<id>"
| project timestamp, itemType, name, duration, success, resultCode
| order by timestamp asc

VM insights, Container insights, Storage and Network monitoring

Feature Collects Needs Notes
VM insights Guest OS metrics (CPU, memory, disk, network), running processes, and Map of dependencies between machines Azure Monitor Agent and a Dependency Agent for the Map, plus a DCR; Log Analytics workspace Works for Azure VMs, scale sets and Arc-enabled servers. Performance and Map views
Container insights Node, pod, controller and container performance, logs (stdout/stderr), Kubernetes events, inventory Monitoring agent in AKS (managed, enabled through the cluster add-on with a DCR), Arc-enabled Kubernetes too Can send Prometheus metrics to Azure Monitor managed service for Prometheus and show them in Azure Managed Grafana. Recommended alerts included
Azure Monitor for Storage (Storage insights) Capacity, availability, latency, transactions and errors per account, with throttling info Platform metrics plus diagnostic settings (resource logs, with StorageRead/Write/Delete categories) Per-service view (blob, file, queue, table)
Azure Monitor for Networks (Network insights) Health and metrics of network resources (load balancers, gateways, ExpressRoute, firewalls) and topology; Connection Monitor, NSG flow logs / virtual network flow logs with Traffic Analytics Network Watcher enabled in the region, flow logs to a storage account and Log Analytics Connectivity and topology troubleshooting

Also relevant: Network Watcher tools (IP flow verify, next hop, packet capture, connection troubleshoot). Azure Monitor Application Insights for app-level data. Azure Monitor managed Prometheus and Managed Grafana for Kubernetes dashboards.

Decision cues:

  • “Memory and process-level data inside a VM and dependencies between servers” -> VM insights.
  • “AKS pod restarts, node CPU, container logs” -> Container insights.
  • “Throttled blob requests or latency on a storage account” -> Storage insights with diagnostic logs.
  • “Traffic between subnets blocked or slow, topology” -> Network insights, Connection Monitor, flow logs.
  • “Exceptions, slow requests, dependency failures in the app” -> Application Insights.

Monitoring in GitHub

Insights and charts

  • Repository Insights: Pulse (activity summary), Contributors, Community, Traffic (views, clones, referrers, popular content), Commits, Code frequency, Dependency graph, Network, Forks.
  • Organisation insights and security overview: security alerts by repo, coverage of GHAS features, and risk.
  • Projects insights: create charts (bar, column, line, stacked area) from project data, with filters and grouping by fields or iteration, such as items per status over iterations (burn-up style), and pin them in a project. Enable via the project’s Insights tab, New chart, set X-axis, Y-axis, group by and filter.
  • Actions usage metrics and performance metrics (organisation level): jobs, minutes, run durations, failure rate, queue times, per workflow or runner. Billing and usage reports show minutes and storage.
  • Copilot metrics for Copilot usage where applicable.

Alerts for GitHub Actions events

  • Notifications: each user can choose to be notified on Actions workflow runs failures (settings > Notifications > Actions: failed workflows only or all, email or web).
  • In a workflow: add a final job with if: failure() (or always()) that posts to Teams or Slack (webhook, slackapi/slack-github-action) or opens an issue; use needs so it sees upstream results. A workflow_run workflow can react to completion of another workflow (types: [completed], check github.event.workflow_run.conclusion).
  • Webhooks and the GitHub app for Teams: subscribe a channel to workflow and deployment events (@github subscribe owner/repo workflows:{event:"push"...}).
  • Status checks and badges surface health in the repository.
  • Log streaming: audit logs to a SIEM; runner metrics through Azure Monitor on self-hosted runners with AMA.

Alerts for Azure Pipelines

  • Notification subscriptions (project settings > Notifications): pre-defined for build completion and failure; add custom subscriptions with filters for build failed, release deployment failed, approval pending, and so on, to email, a team or group.
  • Service hooks send build completed, release deployment completed and run state changed events to Teams, Slack, a webhook, Service Bus or an Azure Function.
  • Azure Pipelines app for Teams/Slack subscribe a channel with filters (@azure pipelines subscribe <url>, then adjust the subscription filters for failed runs only).
  • Pipeline-run status badges on the README, and dashboard widgets (Build history, Deployment status).
  • Alert-on-pipeline-metrics: export pipeline data to Log Analytics (via audit streams, REST, or Power BI/Analytics) and create log alerts.

Alerts in Azure Monitor

Alert type Evaluates Use
Metric alert Platform or custom metric against a static or dynamic threshold (ML-learned baselines, handles seasonality). Fast, 1-minute evaluation possible Latency, CPU, queue depth
Log search alert A KQL query result on a schedule (count, metric measurement). Supports resource-centric or workspace scope Specific errors in logs, complex conditions
Activity log alert Control-plane events (resource deleted, service health, policy) Governance, Service Health incidents
Smart detection alert Application Insights anomaly detection Failure anomalies
Availability alert Availability test failing from several locations Endpoint down
Prometheus alert PromQL rules on managed Prometheus Kubernetes

Alert components:

  • Alert rule: scope (resource), condition (signal and logic), severity (Sev 0 critical to Sev 4 verbose), evaluation frequency and window, and action groups.
  • Action group: reusable set of notifications (email, SMS, push, voice) and actions (webhook, Logic App, Azure Function, Automation runbook, ITSM, Event Hub, Secure webhook) – shared across many rules.
  • Alert processing rules (formerly action rules): suppress alerts during planned maintenance or add action groups to alerts in a scope, without editing every rule.
  • Alert states: New, Acknowledged, Closed. Metric alerts are stateful (fire once, resolve automatically). Log alerts can be stateful too.
  • Multiple resources: a single metric rule can cover many resources of the same type in a subscription or resource group in one region, and dimensions split by instance.
  • Good alerting: alert on symptoms (user-facing latency and errors, SLO burn) more than causes, avoid noise, route by severity, document runbooks.

Analysing metrics

Infrastructure performance indicators

Resource Indicators
CPU Percentage CPU; sustained high suggests scale-out or a runaway process
Memory Available memory / Available Memory Bytes; guest memory needs VM insights/AMA (host metrics don’t include it). Watch for swapping and out-of-memory kills in containers
Disk IOPS, throughput, queue depth, latency, and disk bursting/throttling (Data Disk IOPS Consumed Percentage), plus free space
Network Bytes in/out, packet drops, SNAT port exhaustion, connection failures, latency

Tools: Metrics explorer (split by dimension, apply filters, use aggregations avg/min/max/sum/count, pin to dashboards), VM insights Performance tab, Workbooks, Advisor recommendations, and autoscale driven by the same metrics.

Application metrics

  • Application performance: server response time (use percentiles, p95/p99, not just average), request rate, failed requests, dependency duration and failure rate, exception rate, availability, and Apdex-style satisfaction.
  • Usage: unique users, sessions, page views, funnels (where users drop off), retention, user flows, events, cohorts. Use them to confirm whether a release delivered value (a feedback loop for DevOps).
  • Golden signals: latency, traffic, errors, saturation.
  • Compare before and after a deployment using release annotations, and cross-check with a canary group.
  • Log-based metrics (computed from logs) vs pre-aggregated metrics (cheap, fast, sent by the SDK) in Application Insights.

Basic KQL

Kusto Query Language queries Log Analytics and Application Insights. It reads left to right with pipes: each operator transforms the table from the previous step.

Operator Purpose
where Filter rows
project Choose and rename columns (project-away drops some)
extend Add calculated columns
summarize Aggregate, with by for grouping: count(), avg(), sum(), max(), dcount(), percentile()
bin() Bucket values, typically time: bin(timestamp, 5m)
order by / sort by Sort (descending by default)
top First N by a column: top 10 by count_ desc
take / limit Any N rows
distinct Unique values
join Combine tables (kind=inner, leftouter)
union Stack tables
render Chart: render timechart
ago() Relative time: ago(1h)
let Define a variable or reusable subquery
parse, split, extract String handling
ingestion_time() When data was ingested

String operators: == (case-sensitive equal), =~ (case-insensitive equal), contains, has (whole term, faster), startswith, in, matches regex. Time filter first for performance.

Examples:

// Failed requests per 5 minutes in the last day
requests
| where timestamp > ago(1d) and success == false
| summarize failures = count() by bin(timestamp, 5m)
| render timechart

// Slowest operations, 95th percentile
requests
| where timestamp > ago(6h)
| summarize p95 = percentile(duration, 95), n = count() by name
| top 10 by p95 desc

// Top exceptions
exceptions
| where timestamp > ago(24h)
| summarize count() by type, outerMessage
| order by count_ desc

// VM CPU above 80% (Log Analytics, Azure Monitor Agent)
Perf
| where ObjectName == "Processor" and CounterName == "% Processor Time"
| summarize avg(CounterValue) by Computer, bin(TimeGenerated, 5m)
| where avg_CounterValue > 80

// Heartbeat: machines not reporting
Heartbeat
| summarize LastBeat = max(TimeGenerated) by Computer
| where LastBeat < ago(15m)

// Container insights: restarts
KubePodInventory
| where TimeGenerated > ago(1h)
| summarize restarts = max(ContainerRestartCount) by Name, Namespace
| where restarts > 0

// Azure activity log: who deleted resources
AzureActivity
| where OperationNameValue endswith "DELETE" and ActivityStatusValue == "Success"
| project TimeGenerated, Caller, ResourceGroup, OperationNameValue

Application Insights tables use timestamp and names like requests, dependencies, exceptions, traces, pageViews, customEvents, availabilityResults, customMetrics; the workspace-based versions show up in Log Analytics as AppRequests, AppDependencies, AppExceptions, AppTraces, AppPageViews, and use TimeGenerated. Don’t mix the two naming sets. The classic names work when you query from inside the Application Insights resource’s Logs blade.

Know: summarize needs an aggregate; project after summarize selects its output columns; count() makes count_ when ordering and countif() counts conditionally; sort by is descending by default; has is faster than contains; case-sensitivity of ==.

Site reliability basics that come up

  • SLI (what you measure), SLO (the target, such as 99.9% of requests under 300 ms), SLA (contract with consequences) and error budget (1 minus SLO). When the budget is spent, slow releases and prioritise reliability.
  • Alert on SLO burn rate rather than a single threshold.
  • Blameless post-mortems and tracking MTTR, MTTD feed continuous improvement (ties back to the metrics in the first domain).
  • Azure Service Health and Resource Health tell you whether Azure itself has a problem. Service Health alerts are activity log alerts.
  • Azure Advisor gives reliability, performance, cost and security recommendations.

Exam checklist

  • You know metrics vs logs and what a Log Analytics workspace, diagnostic setting, data collection rule and Azure Monitor Agent do.
  • You can wire an alert to a pipeline, Teams or a work item with action groups, Logic Apps and webhooks, and use the Query Azure Monitor alerts gate for deployments.
  • You can say what Application Insights collects, workspace-based resources, OpenTelemetry distro, connection string, sampling, Live Metrics, Application Map, availability tests and Smart detection.
  • You can explain distributed tracing with operation IDs and W3C trace context, and which feature shows an end-to-end transaction.
  • You can match VM insights, Container insights, Storage insights and Network insights to the symptom.
  • You know GitHub Insights and Projects charts, and how to alert on Actions failures (notifications, a failure job, Teams app) and on Azure Pipelines (notifications, service hooks, Teams app).
  • You can read basic KQL: where, project, summarize ... by bin(), top, render timechart, ago(), join, let.
  • You can name CPU, memory, disk and network indicators and the tool that surfaces each, including that guest memory needs the agent.

Test what you just read. 35 practice questions on implement an instrumentation strategy.

Practise this domain

All AZ-400 notes