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