| title | Monitor Azure SQL Database | |
|---|---|---|
| description | Start here to learn how to monitor Azure SQL Database. | |
| author | WilliamDAssafMSFT | |
| ms.author | wiassaf | |
| ms.reviewer | mathoma, dfurman | |
| ms.date | 08/07/2025 | |
| ms.service | azure-sql-database | |
| ms.subservice | monitoring | |
| ms.topic | concept-article | |
| ms.custom |
|
[!INCLUDE appliesto-sqldb]
[!INCLUDE horz-monitor-intro]
The SQL Server database engine has its own monitoring and diagnostic capabilities that Azure SQL Database uses, such as Query Store and dynamic management views (DMVs). For more information, see Monitor performance by using the Query Store and Monitor performance using dynamic management views.
For a detailed discussion of all monitoring and performance aspects of Azure SQL Database and Azure SQL Managed Instance, see Monitor and performance tuning in Azure SQL Database and Azure SQL Managed Instance.
Important
For a set of recommended alert rules, see Monitor Azure SQL Database with metrics and alerts.
Database watcher collects in-depth workload monitoring data to give you a detailed view of database performance, configuration, and health. Dashboards in the Azure portal provide a single-pane-of-glass view of your Azure SQL estate and a detailed view of each monitored resource. Data is collected into a central data store in your Azure subscription. You can query, analyze, export, visualize collected data and integrate it with downstream systems.
For more information about database watcher, see the following articles:
- Monitor Azure SQL workloads with database watcher (preview)
- Quickstart: Create a watcher to monitor Azure SQL (preview)
- Create and configure a watcher (preview)
- Database watcher data collection and datasets (preview)
- Analyze database watcher monitoring data (preview)
- Database watcher FAQ
Query performance insight uses the SQL Server Query Store to provide intelligent query analysis and insight on query plan choice and performance for single and pooled databases. For more information, see Query Performance Insight for Azure SQL Database.
[!INCLUDE horz-monitor-resource-types]
For more information about the resource types for SQL Database, see Azure SQL Database monitoring data reference.
[!INCLUDE horz-monitor-data-storage]
[!INCLUDE horz-monitor-platform-metrics]
You can use metrics to monitor database and elastic pool resource consumption and health. For example, you can:
- Right-size the database or elastic pool to your application workload
- Detect a gradual increase in resource consumption, and proactively scale up the database or elastic pool
- Detect and troubleshoot a performance problem
For a list and descriptions of commonly used metrics in Azure SQL Database, see Azure SQL Database metrics.
For tables of all available metrics for SQL Database, see SQL Database monitoring data reference.
[!INCLUDE horz-monitor-resource-logs]
Auditing for Azure SQL Database tracks database events and writes them to an audit log in your Azure storage account, Log Analytics workspace, or Event Hubs. For more information, see Auditing for Azure SQL Database.
For more information on the resource logs and diagnostics available for Azure SQL Database, see Configure streaming export of diagnostic telemetry.
For the available resource log categories, their associated Log Analytics tables, and the log schemas for SQL Database, see SQL Database monitoring data reference.
[!INCLUDE horz-monitor-activity-log]
[!INCLUDE horz-monitor-analyze-data]
[!INCLUDE horz-monitor-external-tools]
[!INCLUDE horz-monitor-kusto-queries]
Note
Occasionally, it might take up to 15 minutes between when an event is emitted and when it appears in a Log Analytics workspace.
Use the following queries to monitor your database. You might see different options available depending on your purchasing model.
Example A: Log_write_percent from the past hour
AzureMetrics
| where ResourceProvider == "MICROSOFT.SQL"
| where TimeGenerated >= ago(60min)
| where MetricName in ('log_write_percent')
| parse _ResourceId with * "/microsoft.sql/servers/" Resource
| summarize Log_Maximum_last60mins = max(Maximum), Log_Minimum_last60mins = min(Minimum), Log_Average_last60mins = avg(Average) by Resource, MetricNameExample B: SQL Server wait types from the past 15 minutes
AzureDiagnostics
| where ResourceProvider == "MICROSOFT.SQL"
| where TimeGenerated >= ago(15min)
| parse _ResourceId with * "/microsoft.sql/servers/" LogicalServerName "/databases/" DatabaseName
| summarize Total_count_15mins = sum(delta_waiting_tasks_count_d) by LogicalServerName, DatabaseName, wait_type_sExample C: SQL Server deadlocks from the past 60 minutes
AzureMetrics
| where ResourceProvider == "MICROSOFT.SQL"
| where TimeGenerated >= ago(60min)
| where MetricName in ('deadlock')
| parse _ResourceId with * "/microsoft.sql/servers/" Resource
| summarize Deadlock_max_60Mins = max(Maximum) by Resource, MetricNameExample D: Avg CPU usage from the past hour
AzureMetrics
| where ResourceProvider == "MICROSOFT.SQL"
| where TimeGenerated >= ago(60min)
| where MetricName in ('cpu_percent')
| parse _ResourceId with * "/microsoft.sql/servers/" Resource
| summarize CPU_Maximum_last60mins = max(Maximum), CPU_Minimum_last60mins = min(Minimum), CPU_Average_last60mins = avg(Average) by Resource, MetricName[!INCLUDE horz-monitor-alerts]
The following table lists common and recommended alert rules for SQL Database. You might see different options available depending on your purchasing model.
| Signal name | Operator | Aggregation type | Threshold value | Description |
|---|---|---|---|---|
| DTU Percentage | Greater than | Average | 80 | Whenever the average DTU percentage is greater than 80% |
| Log I/O percentage | Greater than | Average | 80 | Whenever the average log io percentage is greater than 80% |
| Deadlocks* | Greater than | Count | 1 | Whenever the count of deadlocks is greater than 1. |
| CPU percentage | Greater than | Average | 80 | Whenever the average cpu percentage is greater than 80% |
* Alerting on deadlocks might be unnecessary and noisy in some applications where deadlocks are expected and properly handled.
Tip
For recommended alert rules and typical alert rule configurations for SQL Database, see Monitor Azure SQL Database with Azure Monitor metrics and alerts.
[!INCLUDE horz-monitor-advisor-recommendations]
- See SQL Database monitoring data reference for a reference of the metrics, logs, and other important values created for SQL Database.
- See Monitoring Azure resources with Azure Monitor for general details on monitoring Azure resources.
- Monitor Azure SQL workloads with database watcher (preview)
- Review Azure Monitor metrics and alerts including recommended alert rules for SQL Database.
- Learn how to Monitor Azure SQL Managed Instance with Azure Monitor.