go-sundheit
go-sundheit copied to clipboard
Different probe types
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 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
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.
Yeah, we have a PR ready https://github.com/AppsFlyer/go-sundheit/pull/25 I will review it tomorrow, then we're definitely good.
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?)
Noted @sagikazarmark I won't have time to review until tomorrow. Promise to consider your arguments too