Skip to main content

Monitoring Tools Matrix

Too many monitoring tools, not sure which to use? This page cuts through the confusion — one place to understand what each tool does, when to use it, and how they relate.

The Matrix

ToolBest ForSQL DBMIVMComplexityExam Weight
Query StoreQuery plan history, regression detectionLow🎯 High
DMVsReal-time diagnostics (waits, sessions, index stats)Medium🎯 High
Azure Monitor MetricsPlatform-level health (CPU%, DTU%, IO%)PartialLow🎯 High
Azure Monitor Logs (KQL)Deep log analysis, custom queriesMedium📖 Medium
Extended EventsLightweight targeted tracingHigh📖 Medium
Intelligent InsightsML-based anomaly detectionLow📖 Medium
Query Performance InsightPortal-based top query viewLow📖 Low
SQL Insights (Azure Monitor)Centralized fleet monitoringMedium📚 Low
Database WatcherReal-time Azure SQL estate monitoringLow📚 New
SQL AssessmentBest practice configuration checksLow📖 Medium
Activity LogControl-plane events (scale, failover, config)Low🎯 Medium
🎯 Exam Focus

DP-300 focuses on: Query Store (plan regression, forced plans), DMVs (wait stats, missing indexes), Azure Monitor Metrics (alerting), and Activity Log (failover detection). Know these 4 well.


"If You Suspect X, Start With Y"

SymptomStart WithThen Go Deeper
Slow queriesQuery Store → Regressed Queries viewDMVs: sys.dm_exec_query_stats
High CPUAzure Monitor: cpu_percent metricDMVs: sys.dm_exec_requests → find top CPU queries
Blocking / deadlocksDMVs: sys.dm_exec_requests + sys.dm_tran_locksExtended Events: blocked_process_report
I/O bottleneckAzure Monitor: physical_data_read_percentDMVs: sys.dm_io_virtual_file_stats
Missing indexesDMVs: sys.dm_db_missing_index_*Query Store: find queries that would benefit
Plan regressionQuery Store → "Regressed Queries"Automatic Tuning: FORCE_LAST_GOOD_PLAN
Connection failuresAzure Monitor: connection_failed metricActivity Log: check for failover events
Throttling (log rate)Azure Monitor: log_write_percent = 100%Scale up vCores or move to BC tier
Unexpected failoverActivity Log: filter by failover eventsAzure Monitor: check resource health
Memory pressureDMVs: sys.dm_os_memory_clerksQuery Store: find memory-heavy queries
tempdb contentionDMVs: sys.dm_exec_requests (wait type = PAGELATCH)Add tempdb files (VM only)
Index fragmentationDMVs: sys.dm_db_index_physical_statsSchedule rebuild/reorganize maintenance

Query Store — Quick Decision Guide

Query Store is your flight recorder — it captures every query's plan and performance over time.

QuestionAnswer
Is it enabled by default?✅ Yes on Azure SQL DB. ❌ Manual on VM. ✅ Yes on MI.
Where is data stored?In the user database (not system DB)
Can I force a specific plan?✅ Yes — like Oracle SQL Profiles
Does it detect regressions?✅ Yes — "Regressed Queries" view
Does it auto-fix regressions?✅ With FORCE_LAST_GOOD_PLAN (Automatic Tuning)
Max retention?Configurable (default 30 days, size-based cleanup)

When to Use Query Store

ScenarioUse Query Store?
"Why did this query slow down last week?"
"Which queries use the most CPU?"
"Did a plan change cause regression?"
"What's happening right now?"❌ Use DMVs
"What wait types are most common?"✅ (wait stats per query in QS)

DMV Quick Reference

DMVs give you real-time, in-the-moment diagnostics. They don't store history — for history, use Query Store.

Essential DMVs for DP-300

DMVWhat It ShowsUse When
sys.dm_exec_requestsCurrently running queries + waits"What's running right now?"
sys.dm_exec_sessionsActive sessions and connection info"Who's connected?"
sys.dm_exec_query_statsAggregated query performance (CPU, reads, duration)"Top resource consumers"
sys.dm_os_wait_statsServer-wide wait statistics"What is SQL Server waiting on?"
sys.dm_db_missing_index_*Missing index suggestions"Which indexes should I create?"
sys.dm_db_index_physical_statsIndex fragmentation levels"Which indexes need maintenance?"
sys.dm_io_virtual_file_statsFile-level I/O statistics"Is storage the bottleneck?"
sys.dm_tran_locksCurrent lock information"What's causing blocking?"
sys.dm_exec_sql_text()SQL text for a given handleUsed with other DMVs via CROSS APPLY
sys.dm_exec_query_plan()Execution plan XMLUsed with other DMVs via CROSS APPLY

Key Wait Types to Know

Wait TypeMeaningCommon Fix
CXPACKET / CXCONSUMERParallelism waitsTune MAXDOP, Cost Threshold
PAGEIOLATCH_*Waiting for I/O (data from disk)Missing indexes, scale storage
LCK_M_*Lock waits (blocking)Optimize queries, shorter transactions
WRITELOGLog write waitsScale storage, move log to faster disk
SOS_SCHEDULER_YIELDCPU pressureScale up, optimize queries
RESOURCE_SEMAPHOREMemory grant waitsReduce query memory needs, scale up
PAGELATCH_*tempdb contentionAdd tempdb files

Extended Events — When DMVs Aren't Enough

Extended Events (XEvents) are the lightweight tracing engine. Use when you need to capture specific events over time.

Use CaseXEvent to Use
Capture deadlock graphsxml_deadlock_report
Track long-running queriessql_batch_completed with duration filter
Monitor blockingblocked_process_report (set threshold first)
Audit login failureserror_reported with error 18456
Track query timeoutsattention event
Monitor file growthdatabase_file_size_change
🎯 Exam Focus

Extended Events vs SQL Trace/Profiler: SQL Trace and SQL Server Profiler are deprecated. Extended Events is the replacement. The exam expects you to know XEvents, not Profiler. XEvents have lower overhead and support Azure SQL DB/MI.


Azure-Native Monitoring Tools

Azure Monitor Metrics

  • What: Platform-level numeric time-series (CPU%, DTU%, IO%, sessions)
  • Latency: ~1 minute
  • Retention: 93 days
  • Cost: Free (platform metrics)
  • Best for: Real-time health dashboards and metric alerts

Azure Monitor Logs (Log Analytics)

  • What: Structured event records queryable with KQL
  • Latency: 2-5 minutes
  • Retention: 30-730 days
  • Cost: Per GB ingested
  • Best for: Deep analysis, audit queries, custom dashboards

Intelligent Insights

  • What: ML-based performance anomaly detection
  • Works with: Azure SQL DB and MI
  • Best for: Automatic detection of regression, blocking, resource limits
  • Output: JSON insight in diagnostic logs

Query Performance Insight

  • What: Portal blade showing top queries by CPU/duration/execution count
  • Works with: Azure SQL DB only
  • Powered by: Query Store data
  • Best for: Quick visual "what's consuming resources?"

Database Watcher (Preview)

  • What: Near-real-time monitoring for Azure SQL estate
  • Works with: Azure SQL DB and MI
  • Best for: Fleet monitoring, dashboards, data collection to Azure Data Explorer
  • Key benefit: Low-latency SQL-level monitoring without agents

SQL Assessment (VM only)

  • What: Configuration best-practice checker
  • Works with: SQL on VM (via SQL IaaS Agent)
  • Best for: Validating VM storage, MAXDOP, tempdb, memory settings
  • Output: Recommendations in Azure Portal

Common Troubleshooting Workflow

Step 1: Detect

SignalTool
High CPU alert firesAzure Monitor → cpu_percent
User reports "application is slow"Azure Monitor → check all metrics
Scheduled job failedSQL Agent history or Azure Monitor alerts

Step 2: Diagnose

FindingNext Action
CPU > 90% sustainedDMVs → sys.dm_exec_requests → find top CPU queries
One specific query is slowQuery Store → check plan history → compare plans
Many queries suddenly slowQuery Store → Regressed Queries → check for plan changes
Blocking detectedDMVs → sys.dm_exec_requests (blocking_session_id)
I/O > 90%DMVs → sys.dm_io_virtual_file_stats → check latency

Step 3: Fix

Root CauseFix
Bad query planForce good plan in Query Store
Missing indexCreate index from sys.dm_db_missing_index_details
Resource limit hitScale up (more vCores, BC tier, or Hyperscale)
Blocking chainOptimize the blocking query, shorten transactions
Parameter sniffingUse OPTIMIZE FOR, RECOMPILE, or PSP (compat 160)

Tool Relationships

ToolFeeds IntoPowered By
Query StoreQuery Performance Insight, Automatic TuningSQL engine internal capture
DMVsCustom scripts, monitoring solutionsSQL engine real-time state
Azure Monitor MetricsMetric Alerts, Dashboards, WorkbooksPlatform telemetry
Azure Monitor LogsLog Alerts, KQL queries, WorkbooksDiagnostic Settings export
Extended EventsCustom analysis, deadlock reviewSQL engine event framework
Intelligent InsightsAzure Monitor LogsML analysis of Query Store + DMV data
Database WatcherAzure Data Explorer dashboardsDirect SQL data collection

Flashcards

What is the difference between Query Store and DMVs?
Click to reveal answer
Query Store: historical per-query plan + stats (flight recorder). DMVs: real-time current state (what's happening NOW). Use QS for 'why did it slow down?' and DMVs for 'what's running right now?'
1 / 8

Quiz

Q1/5
0 correct
A query that ran fine for months suddenly became slow. Which tool should you check FIRST?