Skip to content

Commit d9874f4

Browse files
author
Issam
committed
feat: INFRA-685 fix minio disk alerts
1 parent 51a9a2c commit d9874f4

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

Diff for: templates/node-exporter.yml.tpl

+18-10
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,8 @@ groups:
5656
expr: count without (device, major, minor, serial, path, model, revision) (node_disk_info{device=~"sd.|vd.",job="${job.tag}-node-exporter"})
5757
%{ if job.expected_disks_count >= 0 ~}
5858
- alert: ${replace(title(replace(job.tag, "-", " ")), " ", "")}DiskCountMismatch
59-
expr: (${replace(job.tag, "-", "_")}:disks:count != ${job.expected_disks_count})
59+
expr: ${replace(job.tag, "-", "_")}:disks:count != ${job.expected_disks_count}
6060
for: 15m
61-
%{ elif job.min_disks_count >= 0 and job.max_disks_count >= 0 ~}
62-
- alert: ${replace(title(replace(job.tag, "-", " ")), " ", "")}DiskCountMismatch
63-
expr: (${replace(job.tag, "-", "_")}:disks:count < ${job.min_disks_count} or ${replace(job.tag, "-", "_")}:disks:count > ${job.max_disks_count})
64-
for: 15m
65-
%{ endif ~}
6661
%{ if length(job.alert_labels) > 0 ~}
6762
labels:
6863
%{ for key, val in job.alert_labels ~}
@@ -71,10 +66,23 @@ groups:
7166
%{ endif ~}
7267
annotations:
7368
summary: "${title(replace(job.tag, "-", " "))} Number of Disks Unexpected"
74-
%{ if job.expected_disks_count >= 0 ~}
75-
description: "Instance *{{ $labels.instance }}* of job *{{ $labels.job }}* has *{{ $value }}* disks. Expected *${job.expected_disks_count}* disks."
76-
%{ elif job.min_disks_count >= 0 and job.max_disks_count >= 0 ~}
77-
description: "Instance *{{ $labels.instance }}* of job *{{ $labels.job }}* has *{{ $value }}* disks. Expected between *${job.min_disks_count}* and *${job.max_disks_count}* disks."
69+
description: "Instance *{{ $labels.instance }}* of job *{{ $labels.job }}* has *{{ $value }}* disks. Expected *${job.expected_disks_count}*."
70+
%{ else ~}
71+
%{ if job.min_disks_count >= 0 ~}
72+
%{ if job.max_disks_count >= 0 }
73+
- alert: ${replace(title(replace(job.tag, "-", " ")), " ", "")}DiskCountRangeMismatch
74+
expr: (${replace(job.tag, "-", "_")}:disks:count < ${job.min_disks_count} or ${replace(job.tag, "-", "_")}:disks:count > ${job.max_disks_count})
75+
for: 15m
76+
%{ if length(job.alert_labels) > 0 ~}
77+
labels:
78+
%{ for key, val in job.alert_labels ~}
79+
${key}: "${val}"
80+
%{ endfor ~}
81+
%{ endif ~}
82+
annotations:
83+
summary: "${title(replace(job.tag, "-", " "))} Disk Count Out of Range"
84+
description: "Instance *{{ $labels.instance }}* of job *{{ $labels.job }}* has *{{ $value }}* disks. Expected between *${job.min_disks_count}* and *${job.max_disks_count}*."
85+
%{ endif }
7886
%{ endif ~}
7987
%{ endif ~}
8088
- record: ${replace(job.tag, "-", "_")}:filesystem_size:gigabytes

0 commit comments

Comments
 (0)