Documentation ¶
Overview ¶
package readiness implements a minimal health-checking mechanism for use as k8s readiness probes. It will always return a "ready" state after the conditions have been met for the first time - it's not meant for monitoring.
Uses a global singleton registry (similar to the Prometheus client's default behavior).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // TODO is a hack to support running multiple phylaxs in one process; // This package should be rewritten to support multiple registries in one process instead of using a global registry NoPanic = false )
Functions ¶
func Handler ¶
func Handler(w http.ResponseWriter, r *http.Request)
Handler returns a net/http handler for the readiness check. It returns 200 OK if all components are ready, or 412 Precondition Failed otherwise. For operator convenience, a list of components and their states is returned as plain text (not meant for machine consumption!).
func RegisterComponent ¶
func RegisterComponent(component Component)
RegisterComponent registers the given component name such that it is required to be ready for the global check to succeed.