| 1 | # you can disable an alarm notification by setting the 'to' line to: silent |
| 2 | |
| 3 | # --- Availability --- |
| 4 | |
| 5 | template: am_sql_database_availability |
| 6 | on: azure_monitor.sql_database.availability |
| 7 | class: Availability |
| 8 | type: Database |
| 9 | component: Azure SQL |
| 10 | lookup: average -10m unaligned of average |
| 11 | units: percentage |
| 12 | every: 1m |
| 13 | warn: $this < (($status >= $WARNING) ? (99.99) : (99.9)) |
| 14 | crit: $this < (($status == $CRITICAL) ? (99.9) : (99)) |
| 15 | delay: down 5m multiplier 1.5 max 1h |
| 16 | summary: SQL Database availability on ${label:resource_name} |
| 17 | info: Database availability of Azure SQL Database ${label:resource_name} \ |
| 18 | in ${label:resource_group} (${label:region}) |
| 19 | to: dba |
| 20 | |
| 21 | # --- CPU Utilization --- |
| 22 | |
| 23 | template: am_sql_database_cpu |
| 24 | on: azure_monitor.sql_database.cpu |
| 25 | class: Utilization |
| 26 | type: Database |
| 27 | component: Azure SQL |
| 28 | lookup: average -5m unaligned of average |
| 29 | units: percentage |
| 30 | every: 1m |
| 31 | warn: $this > (($status >= $WARNING) ? (75) : (85)) |
| 32 | crit: $this > (($status == $CRITICAL) ? (85) : (95)) |
| 33 | delay: down 5m multiplier 1.5 max 1h |
| 34 | summary: SQL Database CPU on ${label:resource_name} |
| 35 | info: Average CPU utilization of Azure SQL Database ${label:resource_name} \ |
| 36 | in ${label:resource_group} (${label:region}) |
| 37 | to: dba |
| 38 | |
| 39 | template: am_sql_database_instance_cpu |
| 40 | on: azure_monitor.sql_database.instance_cpu |
| 41 | class: Utilization |
| 42 | type: Database |
| 43 | component: Azure SQL |
| 44 | lookup: average -5m unaligned of average |
| 45 | units: percentage |
| 46 | every: 1m |
| 47 | warn: $this > (($status >= $WARNING) ? (75) : (85)) |
| 48 | crit: $this > (($status == $CRITICAL) ? (85) : (95)) |
| 49 | delay: down 5m multiplier 1.5 max 1h |
| 50 | summary: SQL Database instance CPU on ${label:resource_name} |
| 51 | info: SQL process CPU utilization (including background tasks) on Azure SQL Database ${label:resource_name} \ |
| 52 | in ${label:resource_group} (${label:region}) |
| 53 | to: dba |
| 54 | |
| 55 | # --- Memory Utilization --- |
| 56 | |
| 57 | template: am_sql_database_instance_memory |
| 58 | on: azure_monitor.sql_database.instance_memory |
| 59 | class: Utilization |
| 60 | type: Database |
| 61 | component: Azure SQL |
| 62 | lookup: average -5m unaligned of average |
| 63 | units: percentage |
| 64 | every: 1m |
| 65 | warn: $this > (($status >= $WARNING) ? (80) : (90)) |
| 66 | crit: $this > (($status == $CRITICAL) ? (90) : (95)) |
| 67 | delay: down 5m multiplier 1.5 max 1h |
| 68 | summary: SQL Database instance memory on ${label:resource_name} |
| 69 | info: SQL process memory utilization on Azure SQL Database ${label:resource_name} \ |
| 70 | in ${label:resource_group} (${label:region}) |
| 71 | to: dba |
| 72 | |
| 73 | # --- DTU Consumption --- |
| 74 | |
| 75 | template: am_sql_database_dtu_consumption |
| 76 | on: azure_monitor.sql_database.dtu_consumption |
| 77 | class: Utilization |
| 78 | type: Database |
| 79 | component: Azure SQL |
| 80 | lookup: average -5m unaligned of average |
| 81 | units: percentage |
| 82 | every: 1m |
| 83 | warn: $this != nan AND $this > (($status >= $WARNING) ? (80) : (90)) |
| 84 | crit: $this != nan AND $this > (($status == $CRITICAL) ? (90) : (95)) |
| 85 | delay: down 5m multiplier 1.5 max 1h |
| 86 | summary: SQL Database DTU consumption on ${label:resource_name} |
| 87 | info: DTU consumption on Azure SQL Database ${label:resource_name} \ |
| 88 | in ${label:resource_group} (${label:region}). \ |
| 89 | Only relevant for DTU-based service tiers |
| 90 | to: dba |
| 91 | |
| 92 | # --- I/O Utilization --- |
| 93 | |
| 94 | template: am_sql_database_data_io |
| 95 | on: azure_monitor.sql_database.io_utilization |
| 96 | class: Utilization |
| 97 | type: Database |
| 98 | component: Azure SQL |
| 99 | lookup: average -5m unaligned of data_read |
| 100 | units: percentage |
| 101 | every: 1m |
| 102 | warn: $this > (($status >= $WARNING) ? (80) : (90)) |
| 103 | crit: $this > (($status == $CRITICAL) ? (90) : (95)) |
| 104 | delay: down 5m multiplier 1.5 max 1h |
| 105 | summary: SQL Database data I/O on ${label:resource_name} |
| 106 | info: Physical data read I/O utilization on Azure SQL Database ${label:resource_name} \ |
| 107 | in ${label:resource_group} (${label:region}) |
| 108 | to: dba |
| 109 | |
| 110 | template: am_sql_database_log_write |
| 111 | on: azure_monitor.sql_database.io_utilization |
| 112 | class: Utilization |
| 113 | type: Database |
| 114 | component: Azure SQL |
| 115 | lookup: average -5m unaligned of log_write |
| 116 | units: percentage |
| 117 | every: 1m |
| 118 | warn: $this > (($status >= $WARNING) ? (80) : (90)) |
| 119 | crit: $this > (($status == $CRITICAL) ? (90) : (95)) |
| 120 | delay: down 5m multiplier 1.5 max 1h |
| 121 | summary: SQL Database log write I/O on ${label:resource_name} |
| 122 | info: Transaction log write I/O utilization on Azure SQL Database ${label:resource_name} \ |
| 123 | in ${label:resource_group} (${label:region}) |
| 124 | to: dba |
| 125 | |
| 126 | # --- Resource Limits (Workers / Sessions) --- |
| 127 | |
| 128 | template: am_sql_database_workers |
| 129 | on: azure_monitor.sql_database.resource_utilization |
| 130 | class: Utilization |
| 131 | type: Database |
| 132 | component: Azure SQL |
| 133 | lookup: average -5m unaligned of workers |
| 134 | units: percentage |
| 135 | every: 1m |
| 136 | warn: $this > (($status >= $WARNING) ? (70) : (80)) |
| 137 | crit: $this > (($status == $CRITICAL) ? (80) : (90)) |
| 138 | delay: down 5m multiplier 1.5 max 1h |
| 139 | summary: SQL Database worker utilization on ${label:resource_name} |
| 140 | info: Worker thread utilization on Azure SQL Database ${label:resource_name} \ |
| 141 | in ${label:resource_group} (${label:region}). \ |
| 142 | Exhausting workers causes query failures |
| 143 | to: dba |
| 144 | |
| 145 | template: am_sql_database_sessions |
| 146 | on: azure_monitor.sql_database.resource_utilization |
| 147 | class: Utilization |
| 148 | type: Database |
| 149 | component: Azure SQL |
| 150 | lookup: average -5m unaligned of sessions |
| 151 | units: percentage |
| 152 | every: 1m |
| 153 | warn: $this > (($status >= $WARNING) ? (70) : (80)) |
| 154 | crit: $this > (($status == $CRITICAL) ? (80) : (90)) |
| 155 | delay: down 5m multiplier 1.5 max 1h |
| 156 | summary: SQL Database session utilization on ${label:resource_name} |
| 157 | info: Session utilization on Azure SQL Database ${label:resource_name} \ |
| 158 | in ${label:resource_group} (${label:region}). \ |
| 159 | Exhausting sessions prevents new connections |
| 160 | to: dba |
| 161 | |
| 162 | # --- Connection Errors --- |
| 163 | |
| 164 | template: am_sql_database_connection_failures |
| 165 | on: azure_monitor.sql_database.connections |
| 166 | class: Errors |
| 167 | type: Database |
| 168 | component: Azure SQL |
| 169 | lookup: average -5m unaligned of failed_system |
| 170 | units: connections/s |
| 171 | every: 1m |
| 172 | warn: $this > (($status >= $WARNING) ? (1) : (5)) |
| 173 | delay: down 5m multiplier 1.5 max 1h |
| 174 | summary: SQL Database system connection failures on ${label:resource_name} |
| 175 | info: Rate of system-caused connection failures on Azure SQL Database ${label:resource_name} \ |
| 176 | in ${label:resource_group} (${label:region}) |
| 177 | to: dba |
| 178 | |
| 179 | template: am_sql_database_firewall_blocks |
| 180 | on: azure_monitor.sql_database.connections |
| 181 | class: Errors |
| 182 | type: Database |
| 183 | component: Azure SQL |
| 184 | lookup: average -5m unaligned of firewall_blocked |
| 185 | units: connections/s |
| 186 | every: 1m |
| 187 | warn: $this > (($status >= $WARNING) ? (1) : (5)) |
| 188 | delay: down 5m multiplier 1.5 max 1h |
| 189 | summary: SQL Database firewall blocks on ${label:resource_name} |
| 190 | info: Rate of connections blocked by firewall on Azure SQL Database ${label:resource_name} \ |
| 191 | in ${label:resource_group} (${label:region}). \ |
| 192 | May indicate misconfigured firewall rules or unauthorized access attempts |
| 193 | to: dba |
| 194 | |
| 195 | # --- Deadlocks --- |
| 196 | |
| 197 | template: am_sql_database_deadlocks |
| 198 | on: azure_monitor.sql_database.deadlocks |
| 199 | class: Errors |
| 200 | type: Database |
| 201 | component: Azure SQL |
| 202 | lookup: average -5m unaligned of total |
| 203 | units: deadlocks/s |
| 204 | every: 1m |
| 205 | warn: $this > (($status >= $WARNING) ? (0) : (1)) |
| 206 | delay: down 5m multiplier 1.5 max 1h |
| 207 | summary: SQL Database deadlocks on ${label:resource_name} |
| 208 | info: Deadlock rate on Azure SQL Database ${label:resource_name} \ |
| 209 | in ${label:resource_group} (${label:region}) |
| 210 | to: dba |
| 211 | |
| 212 | # --- Storage --- |
| 213 | |
| 214 | template: am_sql_database_storage_utilization |
| 215 | on: azure_monitor.sql_database.storage_utilization |
| 216 | class: Utilization |
| 217 | type: Database |
| 218 | component: Azure SQL |
| 219 | lookup: average -5m unaligned of average |
| 220 | units: percentage |
| 221 | every: 1m |
| 222 | warn: $this > (($status >= $WARNING) ? (75) : (85)) |
| 223 | crit: $this > (($status == $CRITICAL) ? (85) : (95)) |
| 224 | delay: down 5m multiplier 1.5 max 1h |
| 225 | summary: SQL Database storage utilization on ${label:resource_name} |
| 226 | info: Data storage utilization on Azure SQL Database ${label:resource_name} \ |
| 227 | in ${label:resource_group} (${label:region}) |
| 228 | to: dba |
| 229 | |
| 230 | # --- In-Memory OLTP --- |
| 231 | |
| 232 | template: am_sql_database_xtp_storage |
| 233 | on: azure_monitor.sql_database.xtp_storage |
| 234 | class: Utilization |
| 235 | type: Database |
| 236 | component: Azure SQL |
| 237 | lookup: average -5m unaligned of average |
| 238 | units: percentage |
| 239 | every: 1m |
| 240 | warn: $this != nan AND $this > (($status >= $WARNING) ? (70) : (80)) |
| 241 | crit: $this != nan AND $this > (($status == $CRITICAL) ? (80) : (90)) |
| 242 | delay: down 5m multiplier 1.5 max 1h |
| 243 | summary: SQL Database In-Memory OLTP storage on ${label:resource_name} |
| 244 | info: In-Memory OLTP storage utilization on Azure SQL Database ${label:resource_name} \ |
| 245 | in ${label:resource_group} (${label:region}). \ |
| 246 | Only relevant when In-Memory OLTP is enabled |
| 247 | to: dba |
| 248 | |
| 249 | # --- Tempdb --- |
| 250 | |
| 251 | template: am_sql_database_tempdb_log_utilization |
| 252 | on: azure_monitor.sql_database.tempdb_log_utilization |
| 253 | class: Utilization |
| 254 | type: Database |
| 255 | component: Azure SQL |
| 256 | lookup: average -5m unaligned of average |
| 257 | units: percentage |
| 258 | every: 1m |
| 259 | warn: $this > (($status >= $WARNING) ? (70) : (80)) |
| 260 | crit: $this > (($status == $CRITICAL) ? (80) : (90)) |
| 261 | delay: down 5m multiplier 1.5 max 1h |
| 262 | summary: SQL Database tempdb log utilization on ${label:resource_name} |
| 263 | info: Tempdb transaction log utilization on Azure SQL Database ${label:resource_name} \ |
| 264 | in ${label:resource_group} (${label:region}). \ |
| 265 | High utilization may indicate long-running transactions or excessive version store usage |
| 266 | to: dba |
| 267 | |
| 268 | # --- Replication --- |
| 269 | |
| 270 | template: am_sql_database_replication_lag |
| 271 | on: azure_monitor.sql_database.replication_lag |
| 272 | class: Latency |
| 273 | type: Database |
| 274 | component: Azure SQL |
| 275 | lookup: average -5m unaligned of average |
| 276 | units: seconds |
| 277 | every: 1m |
| 278 | warn: $this != nan AND $this > (($status >= $WARNING) ? (5) : (10)) |
| 279 | crit: $this != nan AND $this > (($status == $CRITICAL) ? (10) : (30)) |
| 280 | delay: down 5m multiplier 1.5 max 1h |
| 281 | summary: SQL Database replication lag on ${label:resource_name} |
| 282 | info: Geo-replication lag on Azure SQL Database ${label:resource_name} \ |
| 283 | in ${label:resource_group} (${label:region}). \ |
| 284 | Only relevant when geo-replication is configured |
| 285 | to: dba |
| 286 | |
| 287 | # --- Serverless --- |
| 288 | |
| 289 | template: am_sql_database_serverless_cpu |
| 290 | on: azure_monitor.sql_database.serverless_utilization |
| 291 | class: Utilization |
| 292 | type: Database |
| 293 | component: Azure SQL |
| 294 | lookup: average -5m unaligned of cpu |
| 295 | units: percentage |
| 296 | every: 1m |
| 297 | warn: $this != nan AND $this > (($status >= $WARNING) ? (75) : (85)) |
| 298 | crit: $this != nan AND $this > (($status == $CRITICAL) ? (85) : (95)) |
| 299 | delay: down 5m multiplier 1.5 max 1h |
| 300 | summary: SQL Database serverless CPU on ${label:resource_name} |
| 301 | info: App-level CPU utilization on serverless Azure SQL Database ${label:resource_name} \ |
| 302 | in ${label:resource_group} (${label:region}). \ |
| 303 | Only relevant for serverless tier databases |
| 304 | to: dba |
| 305 | |
| 306 | template: am_sql_database_serverless_memory |
| 307 | on: azure_monitor.sql_database.serverless_utilization |
| 308 | class: Utilization |
| 309 | type: Database |
| 310 | component: Azure SQL |
| 311 | lookup: average -5m unaligned of memory |
| 312 | units: percentage |
| 313 | every: 1m |
| 314 | warn: $this != nan AND $this > (($status >= $WARNING) ? (80) : (90)) |
| 315 | crit: $this != nan AND $this > (($status == $CRITICAL) ? (90) : (95)) |
| 316 | delay: down 5m multiplier 1.5 max 1h |
| 317 | summary: SQL Database serverless memory on ${label:resource_name} |
| 318 | info: App-level memory utilization on serverless Azure SQL Database ${label:resource_name} \ |
| 319 | in ${label:resource_group} (${label:region}). \ |
| 320 | Only relevant for serverless tier databases |
| 321 | to: dba |
| 322 | |
| 323 | # --- Ledger --- |
| 324 | |
| 325 | template: am_sql_database_ledger_digest_failures |
| 326 | on: azure_monitor.sql_database.ledger_digest |
| 327 | class: Errors |
| 328 | type: Database |
| 329 | component: Azure SQL |
| 330 | lookup: average -5m unaligned of failed |
| 331 | units: events/s |
| 332 | every: 1m |
| 333 | warn: $this != nan AND $this > 0 |
| 334 | delay: down 5m multiplier 1.5 max 1h |
| 335 | summary: SQL Database ledger digest failures on ${label:resource_name} |
| 336 | info: Failed ledger digest uploads on Azure SQL Database ${label:resource_name} \ |
| 337 | in ${label:resource_group} (${label:region}). \ |
| 338 | Only relevant when database ledger is enabled |
| 339 | to: dba |