Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prober ¶
type Prober struct {
// contains filtered or unexported fields
}
Prober represents health and readiness status of given component.
From Kubernetes documentation https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/ :
liveness: Many applications running for long periods of time eventually transition to broken states, (healthy) and cannot recover except by being restarted. Kubernetes provides liveness probes to detect and remedy such situations. readiness: Sometimes, applications are temporarily unable to serve traffic. (ready) For example, an application might need to load large data or configuration files during startup, or depend on external services after startup. In such cases, you don’t want to kill the application, but you don’t want to send it requests either. Kubernetes provides readiness probes to detect and mitigate these situations. A pod with containers reporting that they are not ready does not receive traffic through Kubernetes Services.
func New ¶ added in v0.9.0
func New(component component.Component, logger log.Logger, reg prometheus.Registerer) *Prober
New returns Prober representing readiness and healthiness of given component.
func (*Prober) Healthy ¶ added in v0.9.0
func (p *Prober) Healthy()
Healthy sets components status to healthy.
func (*Prober) HealthyHandler ¶ added in v0.9.0
func (p *Prober) HealthyHandler() http.HandlerFunc
HealthyHandler returns a HTTP Handler which responds health checks.
func (*Prober) NotHealthy ¶ added in v0.9.0
NotHealthy sets components status to not healthy with given error as a cause.
func (*Prober) NotReady ¶ added in v0.9.0
NotReady sets components status to not ready with given error as a cause.
func (*Prober) Ready ¶ added in v0.9.0
func (p *Prober) Ready()
Ready sets components status to ready.
func (*Prober) ReadyHandler ¶ added in v0.9.0
func (p *Prober) ReadyHandler() http.HandlerFunc
ReadyHandler returns a HTTP Handler which responds readiness checks.