| 1 | # you can disable an alarm notification by setting the 'to' line to: silent |
| 2 | |
| 3 | # --- Utilization --- |
| 4 | |
| 5 | template: am_mysql_flexible_cpu |
| 6 | on: azure_monitor.mysql_flexible.cpu |
| 7 | class: Utilization |
| 8 | type: Database |
| 9 | component: Azure MySQL Flexible |
| 10 | lookup: average -5m unaligned of average |
| 11 | units: percentage |
| 12 | every: 1m |
| 13 | warn: $this > (($status >= $WARNING) ? (75) : (85)) |
| 14 | crit: $this > (($status == $CRITICAL) ? (85) : (95)) |
| 15 | delay: down 5m multiplier 1.5 max 1h |
| 16 | summary: MySQL Flexible CPU on ${label:resource_name} |
| 17 | info: Average CPU utilization on Azure MySQL Flexible Server ${label:resource_name} \ |
| 18 | in ${label:resource_group} (${label:region}) |
| 19 | to: dba |
| 20 | |
| 21 | template: am_mysql_flexible_memory |
| 22 | on: azure_monitor.mysql_flexible.memory |
| 23 | class: Utilization |
| 24 | type: Database |
| 25 | component: Azure MySQL Flexible |
| 26 | lookup: average -5m unaligned of average |
| 27 | units: percentage |
| 28 | every: 1m |
| 29 | warn: $this > (($status >= $WARNING) ? (75) : (85)) |
| 30 | crit: $this > (($status == $CRITICAL) ? (85) : (95)) |
| 31 | delay: down 5m multiplier 1.5 max 1h |
| 32 | summary: MySQL Flexible memory on ${label:resource_name} |
| 33 | info: Average memory utilization on Azure MySQL Flexible Server ${label:resource_name} \ |
| 34 | in ${label:resource_group} (${label:region}) |
| 35 | to: dba |
| 36 | |
| 37 | template: am_mysql_flexible_io_utilization |
| 38 | on: azure_monitor.mysql_flexible.io_utilization |
| 39 | class: Utilization |
| 40 | type: Database |
| 41 | component: Azure MySQL Flexible |
| 42 | lookup: average -5m unaligned of average |
| 43 | units: percentage |
| 44 | every: 1m |
| 45 | warn: $this > (($status >= $WARNING) ? (80) : (90)) |
| 46 | crit: $this > (($status == $CRITICAL) ? (90) : (95)) |
| 47 | delay: down 5m multiplier 1.5 max 1h |
| 48 | summary: MySQL Flexible I/O utilization on ${label:resource_name} |
| 49 | info: Average storage I/O utilization on Azure MySQL Flexible Server ${label:resource_name} \ |
| 50 | in ${label:resource_group} (${label:region}). \ |
| 51 | Sustained high I/O can cause query performance degradation |
| 52 | to: dba |
| 53 | |
| 54 | template: am_mysql_flexible_storage_utilization |
| 55 | on: azure_monitor.mysql_flexible.storage_utilization |
| 56 | class: Utilization |
| 57 | type: Database |
| 58 | component: Azure MySQL Flexible |
| 59 | lookup: average -5m unaligned of average |
| 60 | units: percentage |
| 61 | every: 1m |
| 62 | warn: $this > (($status >= $WARNING) ? (75) : (80)) |
| 63 | crit: $this > (($status == $CRITICAL) ? (85) : (90)) |
| 64 | delay: down 5m multiplier 1.5 max 1h |
| 65 | summary: MySQL Flexible storage on ${label:resource_name} |
| 66 | info: Storage utilization on Azure MySQL Flexible Server ${label:resource_name} \ |
| 67 | in ${label:resource_group} (${label:region}). \ |
| 68 | When storage reaches 100% the server becomes read-only |
| 69 | to: dba |
| 70 | |
| 71 | template: am_mysql_flexible_serverlog_storage_utilization |
| 72 | on: azure_monitor.mysql_flexible.serverlog_storage_utilization |
| 73 | class: Utilization |
| 74 | type: Database |
| 75 | component: Azure MySQL Flexible |
| 76 | lookup: average -5m unaligned of average |
| 77 | units: percentage |
| 78 | every: 1m |
| 79 | warn: $this > (($status >= $WARNING) ? (75) : (85)) |
| 80 | crit: $this > (($status == $CRITICAL) ? (85) : (95)) |
| 81 | delay: down 5m multiplier 1.5 max 1h |
| 82 | summary: MySQL Flexible server log storage on ${label:resource_name} |
| 83 | info: Server log storage utilization on Azure MySQL Flexible Server ${label:resource_name} \ |
| 84 | in ${label:resource_group} (${label:region}) |
| 85 | to: dba |
| 86 | |
| 87 | template: am_mysql_flexible_cpu_credits_remaining |
| 88 | on: azure_monitor.mysql_flexible.cpu_credits |
| 89 | class: Utilization |
| 90 | type: Database |
| 91 | component: Azure MySQL Flexible |
| 92 | lookup: average -5m unaligned of remaining |
| 93 | units: credits |
| 94 | every: 1m |
| 95 | warn: $this != nan AND $this < (($status >= $WARNING) ? (30) : (20)) |
| 96 | delay: down 5m multiplier 1.5 max 1h |
| 97 | summary: MySQL Flexible CPU credits low on ${label:resource_name} |
| 98 | info: Remaining CPU credits on Azure MySQL Flexible Server ${label:resource_name} \ |
| 99 | in ${label:resource_group} (${label:region}). \ |
| 100 | Only applicable to burstable tier; exhaustion causes CPU throttling |
| 101 | to: dba |
| 102 | |
| 103 | # --- Availability --- |
| 104 | |
| 105 | template: am_mysql_flexible_ha_io_status |
| 106 | on: azure_monitor.mysql_flexible.ha_status |
| 107 | class: Availability |
| 108 | type: Database |
| 109 | component: Azure MySQL Flexible |
| 110 | lookup: average -5m unaligned of io |
| 111 | units: status |
| 112 | every: 1m |
| 113 | crit: $this != nan AND $this < 1 |
| 114 | delay: down 5m multiplier 1.5 max 1h |
| 115 | summary: MySQL Flexible HA IO thread down on ${label:resource_name} |
| 116 | info: HA replication IO thread is not running on Azure MySQL Flexible Server ${label:resource_name} \ |
| 117 | in ${label:resource_group} (${label:region}). \ |
| 118 | Only relevant when high availability is configured |
| 119 | to: dba |
| 120 | |
| 121 | template: am_mysql_flexible_ha_sql_status |
| 122 | on: azure_monitor.mysql_flexible.ha_status |
| 123 | class: Availability |
| 124 | type: Database |
| 125 | component: Azure MySQL Flexible |
| 126 | lookup: average -5m unaligned of sql |
| 127 | units: status |
| 128 | every: 1m |
| 129 | crit: $this != nan AND $this < 1 |
| 130 | delay: down 5m multiplier 1.5 max 1h |
| 131 | summary: MySQL Flexible HA SQL thread down on ${label:resource_name} |
| 132 | info: HA replication SQL thread is not running on Azure MySQL Flexible Server ${label:resource_name} \ |
| 133 | in ${label:resource_group} (${label:region}). \ |
| 134 | Only relevant when high availability is configured |
| 135 | to: dba |
| 136 | |
| 137 | template: am_mysql_flexible_replica_io_status |
| 138 | on: azure_monitor.mysql_flexible.replica_status |
| 139 | class: Availability |
| 140 | type: Database |
| 141 | component: Azure MySQL Flexible |
| 142 | lookup: average -5m unaligned of io |
| 143 | units: status |
| 144 | every: 1m |
| 145 | crit: $this != nan AND $this < 1 |
| 146 | delay: down 5m multiplier 1.5 max 1h |
| 147 | summary: MySQL Flexible replica IO thread down on ${label:resource_name} |
| 148 | info: Read replica IO thread is not running on Azure MySQL Flexible Server ${label:resource_name} \ |
| 149 | in ${label:resource_group} (${label:region}). \ |
| 150 | Only relevant when read replicas are configured |
| 151 | to: dba |
| 152 | |
| 153 | template: am_mysql_flexible_replica_sql_status |
| 154 | on: azure_monitor.mysql_flexible.replica_status |
| 155 | class: Availability |
| 156 | type: Database |
| 157 | component: Azure MySQL Flexible |
| 158 | lookup: average -5m unaligned of sql |
| 159 | units: status |
| 160 | every: 1m |
| 161 | crit: $this != nan AND $this < 1 |
| 162 | delay: down 5m multiplier 1.5 max 1h |
| 163 | summary: MySQL Flexible replica SQL thread down on ${label:resource_name} |
| 164 | info: Read replica SQL thread is not running on Azure MySQL Flexible Server ${label:resource_name} \ |
| 165 | in ${label:resource_group} (${label:region}). \ |
| 166 | Only relevant when read replicas are configured |
| 167 | to: dba |
| 168 | |
| 169 | # --- Replication --- |
| 170 | |
| 171 | template: am_mysql_flexible_replication_lag |
| 172 | on: azure_monitor.mysql_flexible.replication_lag |
| 173 | class: Latency |
| 174 | type: Database |
| 175 | component: Azure MySQL Flexible |
| 176 | lookup: average -5m unaligned of replica |
| 177 | units: seconds |
| 178 | every: 1m |
| 179 | warn: $this != nan AND $this > (($status >= $WARNING) ? (20) : (30)) |
| 180 | crit: $this != nan AND $this > (($status == $CRITICAL) ? (30) : (60)) |
| 181 | delay: down 5m multiplier 1.5 max 1h |
| 182 | summary: MySQL Flexible replica lag on ${label:resource_name} |
| 183 | info: Read replica replication lag on Azure MySQL Flexible Server ${label:resource_name} \ |
| 184 | in ${label:resource_group} (${label:region}). \ |
| 185 | Only relevant when read replicas are configured |
| 186 | to: dba |
| 187 | |
| 188 | template: am_mysql_flexible_ha_replication_lag |
| 189 | on: azure_monitor.mysql_flexible.replication_lag |
| 190 | class: Latency |
| 191 | type: Database |
| 192 | component: Azure MySQL Flexible |
| 193 | lookup: average -5m unaligned of ha |
| 194 | units: seconds |
| 195 | every: 1m |
| 196 | warn: $this != nan AND $this > (($status >= $WARNING) ? (10) : (20)) |
| 197 | crit: $this != nan AND $this > (($status == $CRITICAL) ? (20) : (30)) |
| 198 | delay: down 5m multiplier 1.5 max 1h |
| 199 | summary: MySQL Flexible HA replication lag on ${label:resource_name} |
| 200 | info: HA standby replication lag on Azure MySQL Flexible Server ${label:resource_name} \ |
| 201 | in ${label:resource_group} (${label:region}). \ |
| 202 | High lag increases data loss risk during failover. \ |
| 203 | Only relevant when high availability is configured |
| 204 | to: dba |
| 205 | |
| 206 | # --- Latency / Contention --- |
| 207 | |
| 208 | template: am_mysql_flexible_innodb_row_lock_time |
| 209 | on: azure_monitor.mysql_flexible.innodb_row_lock_time |
| 210 | class: Latency |
| 211 | type: Database |
| 212 | component: Azure MySQL Flexible |
| 213 | lookup: average -5m unaligned of average |
| 214 | units: milliseconds |
| 215 | every: 1m |
| 216 | warn: $this > (($status >= $WARNING) ? (200) : (500)) |
| 217 | crit: $this > (($status == $CRITICAL) ? (500) : (1000)) |
| 218 | delay: down 5m multiplier 1.5 max 1h |
| 219 | summary: MySQL Flexible row lock wait time on ${label:resource_name} |
| 220 | info: Average InnoDB row lock wait time on Azure MySQL Flexible Server ${label:resource_name} \ |
| 221 | in ${label:resource_group} (${label:region}). \ |
| 222 | High values indicate significant lock contention between transactions |
| 223 | to: dba |
| 224 | |
| 225 | template: am_mysql_flexible_lock_deadlocks |
| 226 | on: azure_monitor.mysql_flexible.lock_deadlocks |
| 227 | class: Errors |
| 228 | type: Database |
| 229 | component: Azure MySQL Flexible |
| 230 | lookup: average -5m unaligned of total |
| 231 | units: deadlocks/s |
| 232 | every: 1m |
| 233 | warn: $this > (($status >= $WARNING) ? (0) : (1)) |
| 234 | crit: $this > (($status == $CRITICAL) ? (1) : (5)) |
| 235 | delay: down 5m multiplier 1.5 max 1h |
| 236 | summary: MySQL Flexible deadlocks on ${label:resource_name} |
| 237 | info: Rate of InnoDB deadlocks on Azure MySQL Flexible Server ${label:resource_name} \ |
| 238 | in ${label:resource_group} (${label:region}). \ |
| 239 | Deadlocks cause transactions to be rolled back |
| 240 | to: dba |
| 241 | |
| 242 | template: am_mysql_flexible_lock_timeouts |
| 243 | on: azure_monitor.mysql_flexible.lock_timeouts |
| 244 | class: Errors |
| 245 | type: Database |
| 246 | component: Azure MySQL Flexible |
| 247 | lookup: average -5m unaligned of total |
| 248 | units: timeouts/s |
| 249 | every: 1m |
| 250 | warn: $this > (($status >= $WARNING) ? (0) : (1)) |
| 251 | crit: $this > (($status == $CRITICAL) ? (1) : (5)) |
| 252 | delay: down 5m multiplier 1.5 max 1h |
| 253 | summary: MySQL Flexible lock timeouts on ${label:resource_name} |
| 254 | info: Rate of lock wait timeouts on Azure MySQL Flexible Server ${label:resource_name} \ |
| 255 | in ${label:resource_group} (${label:region}). \ |
| 256 | Timeouts indicate long-held locks blocking other transactions |
| 257 | to: dba |
| 258 | |
| 259 | # --- Errors --- |
| 260 | |
| 261 | template: am_mysql_flexible_aborted_connections |
| 262 | on: azure_monitor.mysql_flexible.aborted_connections |
| 263 | class: Errors |
| 264 | type: Database |
| 265 | component: Azure MySQL Flexible |
| 266 | lookup: average -5m unaligned of total |
| 267 | units: connections/s |
| 268 | every: 1m |
| 269 | warn: $this > (($status >= $WARNING) ? (3) : (5)) |
| 270 | crit: $this > (($status == $CRITICAL) ? (10) : (20)) |
| 271 | delay: down 5m multiplier 1.5 max 1h |
| 272 | summary: MySQL Flexible aborted connections on ${label:resource_name} |
| 273 | info: Rate of aborted connections on Azure MySQL Flexible Server ${label:resource_name} \ |
| 274 | in ${label:resource_group} (${label:region}). \ |
| 275 | Common causes include authentication failures, connection timeouts, and client errors |
| 276 | to: dba |
| 277 | |
| 278 | # --- Performance --- |
| 279 | |
| 280 | template: am_mysql_flexible_slow_queries |
| 281 | on: azure_monitor.mysql_flexible.queries |
| 282 | class: Workload |
| 283 | type: Database |
| 284 | component: Azure MySQL Flexible |
| 285 | lookup: average -5m unaligned of slow |
| 286 | units: queries/s |
| 287 | every: 1m |
| 288 | warn: $this > (($status >= $WARNING) ? (5) : (10)) |
| 289 | crit: $this > (($status == $CRITICAL) ? (10) : (25)) |
| 290 | delay: down 5m multiplier 1.5 max 1h |
| 291 | summary: MySQL Flexible slow queries on ${label:resource_name} |
| 292 | info: Rate of slow queries on Azure MySQL Flexible Server ${label:resource_name} \ |
| 293 | in ${label:resource_group} (${label:region}). \ |
| 294 | Review slow query log for optimization opportunities |
| 295 | to: dba |
| 296 | |
| 297 | template: am_mysql_flexible_innodb_row_lock_waits |
| 298 | on: azure_monitor.mysql_flexible.innodb_row_lock_waits |
| 299 | class: Latency |
| 300 | type: Database |
| 301 | component: Azure MySQL Flexible |
| 302 | lookup: average -5m unaligned of total |
| 303 | units: waits/s |
| 304 | every: 1m |
| 305 | warn: $this > (($status >= $WARNING) ? (50) : (100)) |
| 306 | crit: $this > (($status == $CRITICAL) ? (100) : (200)) |
| 307 | delay: down 5m multiplier 1.5 max 1h |
| 308 | summary: MySQL Flexible row lock waits on ${label:resource_name} |
| 309 | info: Rate of InnoDB row lock waits on Azure MySQL Flexible Server ${label:resource_name} \ |
| 310 | in ${label:resource_group} (${label:region}). \ |
| 311 | High lock waits degrade query throughput and increase response times |
| 312 | to: dba |
| 313 | |
| 314 | template: am_mysql_flexible_history_list_length |
| 315 | on: azure_monitor.mysql_flexible.history_list_length |
| 316 | class: Utilization |
| 317 | type: Database |
| 318 | component: Azure MySQL Flexible |
| 319 | lookup: average -5m unaligned of maximum |
| 320 | units: entries |
| 321 | every: 1m |
| 322 | warn: $this > (($status >= $WARNING) ? (50000) : (100000)) |
| 323 | crit: $this > (($status == $CRITICAL) ? (100000) : (1000000)) |
| 324 | delay: down 5m multiplier 1.5 max 1h |
| 325 | summary: MySQL Flexible history list length on ${label:resource_name} |
| 326 | info: InnoDB history list length (undo log entries) on Azure MySQL Flexible Server ${label:resource_name} \ |
| 327 | in ${label:resource_group} (${label:region}). \ |
| 328 | A growing history list indicates long-running transactions preventing purge |
| 329 | to: dba |