Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance MySQLDown alert #2186

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions roles/kube_prometheus_stack/files/jsonnet/mixins.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ local disabledAlerts = [
// * Dropped `CephPGImbalance`
// the balancer module takes care of this
'CephPGImbalance',

// * Dropped `MySQLDown` due to noisy alerts even
// the replication still more than minimum
'MySQLDown',
];

// NOTE(mnaser): This is the default mapping for severities:
Expand Down Expand Up @@ -141,6 +145,29 @@ local mixins = {
severity: 'warning',
},
},
{
alert: 'MysqlClusterDown',
'for': '1m',
expr: 'count(mysql_up==0) != count(mysql_up)',
labels: {
severity: 'info',
},
annotations: {
summary: '{{ $value }} percona-xtradb replication down',
},
},
{
alert: 'MysqlClusterDown',
'for': '1m',
expr: 'count(mysql_up==1) < 3',
mnaser marked this conversation as resolved.
Show resolved Hide resolved
labels: {
severity: 'warning',
},
annotations: {
summary: 'Only {{ $value }} percona-xtradb cluster are online',
description: "percona-xtradb cluster less than 3 replication, please check with kubectl get pods -n openstack -l app.kubernetes.io/component=pxc",
},
},
],
},
],
Expand Down
15 changes: 15 additions & 0 deletions roles/kube_prometheus_stack/files/jsonnet/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,18 @@ tests:
- eval_time: 5m
alertname: NodeTimeSkewDetected
exp_alerts: []

- interval: 1m
input_series:
- series: 'mysql_up'
values: '1'
input_series:
- series: 'mysql_up'
values: '1'
input_series:
- series: 'mysql_up'
values: '0'
mnaser marked this conversation as resolved.
Show resolved Hide resolved
alert_rule_test:
- eval_time: 5m
alertname: MysqlClusterDown
exp_alerts: []
Loading