Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCProbe ¶
type GRPCProbe struct {
// contains filtered or unexported fields
}
GRPCProbe represents health and readiness status of given component, and provides GRPC integration.
func NewGRPC ¶
func NewGRPC() *GRPCProbe
NewGRPC creates a Probe that wrapped around grpc/healt.Server which reflects status of server.
func (*GRPCProbe) HealthServer ¶
HealthServer returns a gRPC health server which responds readiness and liveness checks.
func (*GRPCProbe) Healthy ¶
func (p *GRPCProbe) Healthy()
Healthy sets components status to healthy.
func (*GRPCProbe) NotHealthy ¶
NotHealthy sets components status to not healthy with given error as a cause.
type HTTPProbe ¶
type HTTPProbe struct {
// contains filtered or unexported fields
}
HTTPProbe represents health and readiness status of given component, and provides HTTP integration.
func NewHTTP ¶
func NewHTTP() *HTTPProbe
NewHTTP returns HTTPProbe representing readiness and healthiness of given component.
func (*HTTPProbe) Healthy ¶
func (p *HTTPProbe) Healthy()
Healthy sets components status to healthy.
func (*HTTPProbe) HealthyHandler ¶
func (p *HTTPProbe) HealthyHandler(logger *log.Logger) http.HandlerFunc
HealthyHandler returns a HTTP Handler which responds health checks.
func (*HTTPProbe) NotHealthy ¶
NotHealthy sets components status to not healthy with given error as a cause.
func (*HTTPProbe) NotReady ¶
NotReady sets components status to not ready with given error as a cause.
func (*HTTPProbe) ReadyHandler ¶
func (p *HTTPProbe) ReadyHandler(logger *log.Logger) http.HandlerFunc
ReadyHandler returns a HTTP Handler which responds readiness checks.
type InstrumentationProbe ¶
type InstrumentationProbe struct {
// contains filtered or unexported fields
}
InstrumentationProbe stores instrumentation state of Probe. This is created with an intention to combine with other Probe's using prober.Combine.
func NewInstrumentation ¶
func NewInstrumentation(component string, logger *log.Logger, reg prometheus.Registerer) *InstrumentationProbe
NewInstrumentation returns InstrumentationProbe records readiness and healthiness for given component.
func (*InstrumentationProbe) Healthy ¶
func (p *InstrumentationProbe) Healthy()
Healthy records the component status when Healthy is called, if combined with other Probes.
func (*InstrumentationProbe) NotHealthy ¶
func (p *InstrumentationProbe) NotHealthy(err error)
NotHealthy records the component status when NotHealthy is called, if combined with other Probes.
func (*InstrumentationProbe) NotReady ¶
func (p *InstrumentationProbe) NotReady(err error)
NotReady records the component status when NotReady is called, if combined with other Probes.
func (*InstrumentationProbe) Ready ¶
func (p *InstrumentationProbe) Ready()
Ready records the component status when Ready is called, if combined with other Probes.
type Probe ¶
Probe 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.