Skip to content

Commit 12a0277

Browse files
committed
storage_alerts: cluster label is optional
This commit make printing the `cluster` label in the storage alerts optional based on the label being present or not. If no `cluster` label is set, the phrase ` {{ with $labels.%(clusterLabel)s -}} on Cluster ` is left out of the alert description. Signed-off-by: Jan Fajerski <[email protected]>
1 parent c72ac03 commit 12a0277

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

alerts/storage_alerts.libsonnet

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
severity: 'critical',
3737
},
3838
annotations: {
39-
description: 'The PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.%(clusterLabel)s }} is only {{ $value | humanizePercentage }} free.' % $._config,
39+
description: 'The PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace }} {{ with $labels.%(clusterLabel)s -}} on Cluster {{ . }} {{- end }} is only {{ $value | humanizePercentage }} free.' % $._config,
4040
summary: 'PersistentVolume is filling up.',
4141
},
4242
},
@@ -62,7 +62,7 @@
6262
severity: 'warning',
6363
},
6464
annotations: {
65-
description: 'Based on recent sampling, the PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.%(clusterLabel)s }} is expected to fill up within four days. Currently {{ $value | humanizePercentage }} is available.' % $._config,
65+
description: 'Based on recent sampling, the PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace }} {{ with $labels.%(clusterLabel)s -}} on Cluster {{ . }} {{- end }} is expected to fill up within four days. Currently {{ $value | humanizePercentage }} is available.' % $._config,
6666
summary: 'PersistentVolume is filling up.',
6767
},
6868
},
@@ -86,7 +86,7 @@
8686
severity: 'critical',
8787
},
8888
annotations: {
89-
description: 'The PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.%(clusterLabel)s }} only has {{ $value | humanizePercentage }} free inodes.' % $._config,
89+
description: 'The PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace }} {{ with $labels.%(clusterLabel)s -}} on Cluster {{ . }} {{- end }} only has {{ $value | humanizePercentage }} free inodes.' % $._config,
9090
summary: 'PersistentVolumeInodes are filling up.',
9191
},
9292
},
@@ -112,7 +112,7 @@
112112
severity: 'warning',
113113
},
114114
annotations: {
115-
description: 'Based on recent sampling, the PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace }} on Cluster {{ $labels.%(clusterLabel)s }} is expected to run out of inodes within four days. Currently {{ $value | humanizePercentage }} of its inodes are free.' % $._config,
115+
description: 'Based on recent sampling, the PersistentVolume claimed by {{ $labels.persistentvolumeclaim }} in Namespace {{ $labels.namespace }} {{ with $labels.%(clusterLabel)s -}} on Cluster {{ . }} {{- end }} is expected to run out of inodes within four days. Currently {{ $value | humanizePercentage }} of its inodes are free.' % $._config,
116116
summary: 'PersistentVolumeInodes are filling up.',
117117
},
118118
},
@@ -126,7 +126,7 @@
126126
severity: 'critical',
127127
},
128128
annotations: {
129-
description: 'The persistent volume {{ $labels.persistentvolume }} on Cluster {{ $labels.%(clusterLabel)s }} has status {{ $labels.phase }}.' % $._config,
129+
description: 'The persistent volume {{ $labels.persistentvolume }} {{ with $labels.%(clusterLabel)s -}} on Cluster {{ . }} {{- end }} has status {{ $labels.phase }}.' % $._config,
130130
summary: 'PersistentVolume is having issues with provisioning.',
131131
},
132132
},

0 commit comments

Comments
 (0)