Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface { // The Handler is an http.Handler, so it can be exposed directly and handle // /live and /ready endpoints. http.Handler // AddLivenessCheck adds a check that indicates that this instance of the // application should be destroyed or restarted. A failed liveness check // indicates that this instance is unhealthy, not some upstream dependency. // Every liveness check is also included as a readiness check. AddLivenessCheck(name string, check healthcheck.Check) // AddReadinessCheck adds a check that indicates that this instance of the // application is currently unable to serve requests because of an upstream // or some transient failure. If a readiness check fails, this instance // should no longer receiver requests, but should not be restarted or // destroyed. AddReadinessCheck(name string, check healthcheck.Check) // LiveEndpoint is the HTTP handlers for just the /live endpoint, which is // useful if you need to attach it into your own HTTP handlers tree. LiveEndpoint(http.ResponseWriter, *http.Request) // ReadyEndpoint is the HTTP handlers for just the /ready endpoint, which is // useful if you need to attach it into your own HTTP handlers tree. ReadyEndpoint(http.ResponseWriter, *http.Request) }
Handler is an http.Handler with additional methods that register health and readiness checks. It handles "/live" and "/ready" HTTP endpoints.
func NewHandler ¶
creates a handlers that listens on /live & /ready and returns liveness and readiness statuses for each provided livenessChecks & readynessChecks it also returns metadata in each response
func NewMetricsHandler ¶
func NewMetricsHandler(registry prometheus.Registerer, namespace string, options Options) Handler
NewMetricsHandler returns a healthcheck Handler that also exposes metrics into the provided Prometheus registry.
Click to show internal directories.
Click to hide internal directories.