add k8s_state_cronjob_last_execution_failed alert (#19801)
Ilya Mashchenko committed
Mar 8, 2025 at 11:43 UTC
496d65091ae326c98442ea2905059ce2f0693902
2 files changed
+23
-1
src/go/plugin/go.d/collector/k8s_state/metadata.yaml
+9
-1
@@ -57,7 +57,15 @@ modules:
57
troubleshooting:
58
problems:
59
list: []
60
- alerts: []
60
+ alerts:
61
+ - name: k8s_state_deployment_condition_available
62
+ metric: k8s_state.deployment_conditions
63
+ info: 'Deployment ${label:k8s_deployment_name} does not have the minimum required replicas'
64
+ link: https://github.com/netdata/netdata/blob/master/src/health/health.d/k8sstate.conf
65
+ - name: k8s_state_cronjob_last_execution_failed
66
+ metric: k8s_state.cronjob_last_execution_status
67
+ info: 'CronJob ${label:k8s_cronjob_name} in ${label:k8s_namespace} failing'
68
+ link: https://github.com/netdata/netdata/blob/master/src/health/health.d/k8sstate.conf
69
metrics:
70
folding:
71
title: Metrics
src/health/health.d/k8sstate.conf
+14
@@ -12,3 +12,17 @@ component: Deployment
12
summary: Deployment ${label:k8s_deployment_name} does not have the minimum required replicas
13
info: Deployment ${label:k8s_deployment_name} does not have the minimum required replicas
14
to: silent
15
+
16
+ template: k8s_state_cronjob_last_execution_failed
17
+ on: k8s_state.cronjob_last_execution_status
18
+ class: Error
19
+ type: Kubernetes
20
+component: CronJob
21
+ every: 10s
22
+ units: status
23
+ calc: $failed
24
+ warn: $this == 1
25
+ delay: down 5m
26
+ summary: CronJob ${label:k8s_cronjob_name} in ${label:k8s_namespace} failing
27
+ info: CronJob ${label:k8s_cronjob_name} in ${label:k8s_namespace} failing
28
+ to: sysadmin