You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
manifests/0000_90_kube-controller-manager-operator_05_alerts: Template console links in alert descriptions
Prometheus alerts support Go templating [1], and this commit uses that
to provide more context like "which namespace?", "which
PodDisruptionBudget?", "where can I find that PDB in the in-cluster
web console?", and "what 'oc' command would I run to see
garbage-collection sync logs?". This should make understanding the
context of the alert more straightforward, with the responder having
to dip into labels and guess.
[1]: https://prometheus.io/docs/prometheus/latest/configuration/template_reference/
Copy file name to clipboardExpand all lines: manifests/0000_90_kube-controller-manager-operator_05_alerts.yaml
+6-5
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,9 @@ spec:
25
25
- alert: PodDisruptionBudgetAtLimit
26
26
annotations:
27
27
summary: The pod disruption budget is preventing further disruption to pods.
28
-
description: The pod disruption budget is at the minimum disruptions allowed level. The number of current healthy pods is equal to the desired healthy pods.
description: The {{ $labels.poddisruptionbudget }} pod disruption budget in the {{ $labels.namespace}} namespace is at the maximum allowed disruption. The number of current healthy pods is equal to the desired healthy pods.{{ with $console_url := "console_url" | query }}{{ if ne (len (label "url" (first $console_url))) 0}} For more information refer to {{ label "url" (first $console_url) }}/k8s/ns/{{ $labels.namespace }}/poddisruptionbudgets/{{ $labels.poddisruptionbudget }}{{ end }}{{ end }}
max by(namespace, poddisruptionbudget) (kube_poddisruptionbudget_status_current_healthy == kube_poddisruptionbudget_status_desired_healthy and on (namespace, poddisruptionbudget) kube_poddisruptionbudget_status_expected_pods > 0)
32
33
for: 60m
@@ -35,17 +36,17 @@ spec:
35
36
- alert: PodDisruptionBudgetLimit
36
37
annotations:
37
38
summary: The pod disruption budget registers insufficient amount of pods.
38
-
description: The pod disruption budget is below the minimum disruptions allowed level and is not satisfied. The number of current healthy pods is less than the desired healthy pods.
39
+
description: The {{ $labels.poddisruptionbudget }} pod disruption budget in the {{ $labels.namespace }} namespace exceeds the maximum allowed disruption and is not satisfied. The number of current healthy pods is {{ $value }} less than the desired healthy pods.{{ with $console_url := "console_url" | query }}{{ if ne (len (label "url" (first $console_url))) 0}} For more information refer to {{ label "url" (first $console_url) }}/k8s/ns/{{ $labels.namespace }}/poddisruptionbudgets/{{ $labels.poddisruptionbudget }}{{ end }}{{ end }}
max by (namespace, poddisruptionbudget) (kube_poddisruptionbudget_status_current_healthy < kube_poddisruptionbudget_status_desired_healthy)
42
+
max by (namespace, poddisruptionbudget) (kube_poddisruptionbudget_status_desired_healthy - kube_poddisruptionbudget_status_current_healthy) > 0
42
43
for: 15m
43
44
labels:
44
45
severity: critical
45
46
- alert: GarbageCollectorSyncFailed
46
47
annotations:
47
48
summary: There was a problem with syncing the resources for garbage collection.
48
-
description: Garbage Collector had a problem with syncing and monitoring the available resources. Please see KubeControllerManager logs for more details.
49
+
description: Garbage Collector had a problem with syncing and monitoring the available resources. Please see KubeControllerManager logs for more details: 'oc -n {{ $labels.namespace }} logs -c {{ $labels.container }} {{ $labels.pod }}'{{ with $console_url := "console_url" | query }}{{ if ne (len (label "url" (first $console_url))) 0}} For more information refer to {{ label "url" (first $console_url) }}/k8s/ns/{{ $labels.namespace }}/pods/{{ $labels.pod }}/logs?container={{ $labels.container }} {{ end }}{{ end }}.
0 commit comments