Documentation
¶
Overview ¶
Package status is a RoadRunner plugin that exposes HTTP endpoints and RPC methods for monitoring the health, readiness, and job queue state of registered plugins.
The plugin starts an HTTP server with three endpoints:
- /health – returns the aggregated health status of every plugin that implements the Checker interface.
- /ready – returns the readiness status of every plugin that implements the Readiness interface.
- /jobs – returns the state of job pipelines from a plugin that implements the JobsChecker interface.
During graceful shutdown the endpoints respond with 503 Service Unavailable (or a configurable status code) so that external load balancers can drain traffic before the process exits.
An RPC service is also registered, providing Status and Ready methods for programmatic access from RoadRunner workers or CLI tools.
Index ¶
Constants ¶
const (
// PluginName declares public plugin name.
PluginName = "status"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Address of the http server
Address string
// Time to wait for a health check response.
CheckTimeout int `mapstructure:"check_timeout"`
UnavailableStatusCode int `mapstructure:"unavailable_status_code"`
}
Config is the configuration reference for the Status plugin
type Configurer ¶
type Health ¶
type Health struct {
// contains filtered or unexported fields
}
func NewHealthHandler ¶
type JobsChecker ¶
type JobsReport ¶
type JobsReport struct {
Pipeline string `json:"pipeline"`
Priority uint64 `json:"priority"`
Ready bool `json:"ready"`
Queue string `json:"queue"`
Active int64 `json:"active"`
Delayed int64 `json:"delayed"`
Reserved int64 `json:"reserved"`
Driver string `json:"driver"`
ErrorMessage string `json:"error_message"`
}
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func (*Plugin) StopHTTPServer ¶
func (c *Plugin) StopHTTPServer()
StopHTTPServer stops the http server, used only for TEST purposes
type Readiness ¶
Readiness interface used to get readiness status from the plugin that means that a worker pool inside the plugin has 1+ plugins which are ready to work at the particular moment