# # # # mysqld的示例普罗米修斯规则/警报。# #注意:请仔细检查阈值和行为可能无法满足# SLOs或标签。# # # #组:-名称:MySQLdAlerts规则:-警报:MySQLDown注释:描述:MySQL{{$标签。工作}}在{{$标签。实例}}不起来。摘要:MySQL没有expr: mysql_up ! = 1: 5 m标签:严重性:关键-名称:GaleraAlerts规则:-警报:MySQLGaleraNotReady注释:描述:{{$标签。工作}}在{{$标签。实例}}是没有准备好。总结:Galera集群节点没有准备好expr: mysql_global_status_wsrep_ready ! = 1: 5 m标签:严重性:警告,警告:MySQLGaleraOutOfSync注释:描述:“{{$标签。工作}}在{{$标签。未同步实例}}({{$价值}}! = 4)。“摘要:Galera集群节点的同步expr: (mysql_global_status_wsrep_local_state ! = 4和mysql_global_variables_wsrep_desync = = 0): 5 m标签:严重性:警告,警告:MySQLGaleraDonorFallingBehind注释:描述:“{{$标签。工作}}在{{$标签。实例}}是供体(hotbackup)和落后(队列大小{{$价值}})。总结:xtradb集群捐赠者节点落后expr: (mysql_global_status_wsrep_local_state = = 2和mysql_global_status_wsrep_local_recv_queue > 100): 5 m标签:严重性:警告,警告:MySQLReplicationNotRunning注释:描述:奴隶复制(IO或SQL)已经超过2分钟。 summary: Slave replication is not running expr: mysql_slave_status_slave_io_running == 0 or mysql_slave_status_slave_sql_running == 0 for: 2m labels: severity: critical - alert: MySQLReplicationLag annotations: description: The mysql slave replication has fallen behind and is not recovering summary: MySQL slave replication is lagging expr: (instance:mysql_slave_lag_seconds > 30) and on(instance) (predict_linear(instance:mysql_slave_lag_seconds[5m], 60 * 2) > 0) for: 1m labels: severity: critical - alert: MySQLReplicationLag annotations: description: The mysql slave replication has fallen behind and is not recovering summary: MySQL slave replication is lagging expr: (instance:mysql_heartbeat_lag_seconds > 30) and on(instance) (predict_linear(instance:mysql_heartbeat_lag_seconds[5m], 60 * 2) > 0) for: 1m labels: severity: critical - alert: MySQLInnoDBLogWaits annotations: description: The innodb logs are waiting for disk at a rate of {{$value}} / second summary: MySQL innodb log writes stalling expr: rate(mysql_global_status_innodb_log_waits[15m]) > 10 labels: severity: warning