Kube-state-metrics: [feature-request] Add metrics from CronJobs

Created on 23 Jan 2017  路  8Comments  路  Source: kubernetes/kube-state-metrics

Most important for monitoring: last successful run time. Last run time, duration, overrun indication, etc would be awesome too :).

CronJobs are still in alpha though, so it might be good to wait for them to at least make it to beta.

Most helpful comment

I have started working on exposing Job metrics. I have a dev build working, I think, though it hasn't been thoroughly tested to ensure there are no edge cases (or cases simply unlike the state of my test clusters) where the code blows up. I haven't started on the unit tests, either. I'm about to start looking at CronJobs to see what can/should be exposed there.

Quite frankly I'm sort of hacking at this. It's going well but if anyone is interested in reviewing code and/or helping write the unit tests, that'd be swell. Otherwise I'll try to get it all done. I'm working here: https://github.com/vdavidoff/kube-state-metrics

All 8 comments

Might also be worth having the PodStatuses for Jobs ( for the number of failures )

Cronjobs are being promoted to beta in 1.6 https://github.com/kubernetes/features/issues/19

this would be super nice to have

Is there any progress on this?

I am currently not aware of anyone working on this, if anyone wants to grab it, go head! :slightly_smiling_face:

I have started working on exposing Job metrics. I have a dev build working, I think, though it hasn't been thoroughly tested to ensure there are no edge cases (or cases simply unlike the state of my test clusters) where the code blows up. I haven't started on the unit tests, either. I'm about to start looking at CronJobs to see what can/should be exposed there.

Quite frankly I'm sort of hacking at this. It's going well but if anyone is interested in reviewing code and/or helping write the unit tests, that'd be swell. Otherwise I'll try to get it all done. I'm working here: https://github.com/vdavidoff/kube-state-metrics

I have Job and CronJob metrics working. I think the metrics I'm exposing, and how I'm exposing them, makes sense, but feedback on that as well as coding choices etc. is most welcome. In fact I highly recommend it.

I can assure you that someone who is more familiar with the tests than I am will be much quicker at getting the _test files done. My plan is to do them as I have time, but I don't know how long that'll be, and I realize that nothing I have done will get merged until those are complete. Or, I assume that's the case, at least.

@vdavidoff feel free to open a PR already, that exactly the situation what they're for :slightly_smiling_face:. Reviews aren't there to make anyone feel bad or unqualified, we can all learn from them and we can track progress a lot better. There is no need for it to be completely done, it's perfectly fine to be work in progress.

If you can't manage to finish the unit tests, but the rest of the implementation is more or less done, we may just pick it up from where you left off - no work is wasted work. Thanks a lot for your effort!

Closed by #131

Was this page helpful?
0 / 5 - 0 ratings