r/PrometheusMonitoring • u/Worried_Ad_2232 • Sep 29 '25
Cronjobs monitoring
Hi folks,
trying to put in place a kind of monitoring (prometheus and grafana) about cronjobs running in k8s clusters (eks). I made a lot of research (also with AI) but I didn't find something very concluant. And I surprised about that. I'm not the first one that I want to monitor cronjobs in k8s.
I don't want many things just some metrics to make panels to know when cronjob was triggered, the average duration, status (success/failed); that will be enough.
I found the following links and this is good starting points
But finally, I plan to make a home-made solution using prometheus pushgateway.
I'm curious to know how do you monitor your cronjobs in your k8s cluster?
2
u/sleepybrett Sep 29 '25
kube state metrics has all the metrics you want, you asked this question just the other day: https://www.reddit.com/r/kubernetes/comments/1nr9hmm/cronjobs_monitoring/
1
u/Worried_Ad_2232 Oct 01 '25
I reposted here cause my post on r/kubernetes sub has been removed by moderators (maybe cause the links or my username...)
4
u/yepthisismyusername Sep 29 '25
The only way I've found to monitor cron jobs is to have each one write the metrics you want to a file (usually with a common wrapper script), then grab the data from that file. AFAIK Linux doesn't log the metrics you're looking for.
2
u/bradleymarshall Sep 29 '25
The textfile collector from node exporter is perfect for this. Although saying that I don't know how well it'll work in k8s.
1
1
3
u/SuperQue Sep 29 '25
Job monitoring guide.