go-sundheit icon indicating copy to clipboard operation
go-sundheit copied to clipboard

Different probe types

Open weeco opened this issue 5 years ago • 5 comments

Hey, is it possible to register different checks / coniditions for the Kubernetes probe types (readines, liveness & startup probe) and expose these different probe types on different endpoints?

For instance I may want to have a single Database check (which checks DB connectivity). If this check fails this should make the readiness & startup probe/endpoint fail but not the liveness probe.

weeco avatar Nov 13 '19 20:11 weeco

@weeco I think that everything should work fine except for the metrics. I made a mistake, and the global health repository status metric isn't unique.

So you can create 2 health repositories, and register an HTTP handler for each on different paths. This should work fine. If the metric is an issue, I'll find time soon to fix it. LMK

eranharel avatar Nov 14 '19 10:11 eranharel

I think that everything should work fine except for the metrics. I made a mistake, and the global health repository status metric isn't unique.

This can easily be fixed IMHO.

I usually use gosundheit as a readiness check only, and use an http handler responding with "ok" as a liveness handler. I rarely use startup probes, but I guess creating a new health repository would be possible.

sagikazarmark avatar Jan 23 '21 01:01 sagikazarmark

Yeah, we have a PR ready https://github.com/AppsFlyer/go-sundheit/pull/25 I will review it tomorrow, then we're definitely good.

eranharel avatar Jan 23 '21 12:01 eranharel

TBH I have several arguments against merging #25 as it is at the moment. And I'm kind of questioning this use case as well (ie. why not just create multiple health checkers?)

sagikazarmark avatar Jan 23 '21 12:01 sagikazarmark

Noted @sagikazarmark I won't have time to review until tomorrow. Promise to consider your arguments too

eranharel avatar Jan 23 '21 13:01 eranharel