mysql rule_prometheus mysql rules

alert: MySQL is down

expr: mysql_up == 0

for: 1m

labels:

severity: critical

annotations:

summary: "Instance {{ $labels.instance }} MySQL is down"

description: "MySQL database is down. This requires immediate action!"

alert: open files high

expr: mysql_global_status_innodb_num_open_files > (mysql_global_variables_open_files_limit) * 0.75

for: 1m

labels:

severity: warning

annotations:

summary: "Instance {{ $labels.instance }} open files high"

description: "Open files is high. Please consider increasing open_files_limit."

alert: Mysql_Too_Many_Slow_Query

expr: rate(mysql_global_status_slow_queries[30m]) > 3

for: 2m

labels:

severity: warning

annotations:

summary: "Instance {{ $labels.instance }} Mysql_Too_Many_Slow_Query detected"

description: "{{$labels.instance}}: Mysql current Slow_Query Sql is more than 3 ,(current value is: {{ $value }})"

alert: Mysql_Deadlock

expr: mysql_global_status_innodb_deadlocks > 0

for: 2m

labels:

severity: warning

annotations:

summary: "Instance {{ $labels.instance }} Mysql_Deadlock detected"

description: "Open files is high. Mysql Deadlock was found ,(current value is: {{ $value }})"

alert: Mysql_Too_Many_sleep_threads

expr: mysql_global_status_threads_running / mysql_global_status_threads_connected * 100 < 30

for: 2m

labels:

severity: warning

annotations:

summary: "{{$labels.instance}}: Mysql_Too_Many_sleep_threads detected"

description: "{{$labels.instance}}: Mysql_sleep_threads percent is more than {{ $value }}, please clean the sleeping threads"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值