Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct { Cluster *arvados.Cluster // If non-nil, Log is called after handling each request. Log func(*http.Request, error) // If non-nil, report clock skew on each health-check. MetricClockSkew prometheus.Gauge // contains filtered or unexported fields }
Aggregator implements service.Handler. It handles "GET /_health/all" by checking the health of all configured services on the cluster and responding 200 if everything is healthy.
func (*Aggregator) CheckHealth ¶
func (agg *Aggregator) CheckHealth() error
func (*Aggregator) ClusterHealth ¶
func (agg *Aggregator) ClusterHealth() ClusterHealthResponse
func (*Aggregator) Done ¶
func (agg *Aggregator) Done() <-chan struct{}
func (*Aggregator) ServeHTTP ¶
func (agg *Aggregator) ServeHTTP(resp http.ResponseWriter, req *http.Request)
type CheckResult ¶
type CheckResult struct { Health string Error string `json:",omitempty"` HTTPStatusCode int `json:",omitempty"` Response map[string]interface{} `json:",omitempty"` ResponseTime json.Number ClockTime time.Time Server string // "Server" header in http response Metrics // contains filtered or unexported fields }
type ClusterHealthResponse ¶
type ClusterHealthResponse struct { // "OK" if all needed services are OK, otherwise "ERROR". Health string // An entry for each known health check of each known instance // of each needed component: "instance of service S on node N // reports health-check C is OK." Checks map[string]CheckResult // An entry for each service type: "service S is OK." This // exposes problems that can't be expressed in Checks, like // "service S is needed, but isn't configured to run // anywhere." Services map[arvados.ServiceName]ServiceHealth // Difference between min/max timestamps in individual // health-check responses. ClockSkew arvados.Duration Errors []string }
type Func ¶
type Func func() error
Func is a health-check function: it returns nil when healthy, an error when not.
type Handler ¶
type Handler struct { // Authentication token. If empty, all requests will return 404. Token string // Route prefix, typically "/_health/". Prefix string // Map of URI paths to health-check Func. The prefix is // omitted: Routes["foo"] is the health check invoked by a // request to "{Prefix}/foo". // // If "ping" is not listed here, it will be added // automatically and will always return a "healthy" response. Routes Routes // If non-nil, Log is called after handling each request. The // error argument is nil if the request was successfully // authenticated and served, even if the health check itself // failed. Log func(*http.Request, error) // contains filtered or unexported fields }
Handler is an http.Handler that responds to authenticated health-check requests with JSON responses like {"health":"OK"} or {"health":"ERROR","error":"error text"}.
Fields of a Handler should not be changed after the Handler is first used.
type Metrics ¶
Click to show internal directories.
Click to hide internal directories.