Documentation
¶
Overview ¶
Package etcdhttp implements HTTP transportation layer for etcdserver.
Index ¶
- Constants
- func HandleDebug(mux *http.ServeMux)
- func HandleHealth(lg *zap.Logger, mux *http.ServeMux, srv ServerHealth)
- func HandleMetrics(mux *http.ServeMux)
- func HandleVersion(mux *http.ServeMux, server etcdserver.Server)
- func NewHealthHandler(lg *zap.Logger, ...) http.HandlerFunc
- func NewPeerHandler(lg *zap.Logger, s etcdserver.ServerPeerV2) http.Handler
- type CheckRegistry
- type Health
- type HealthCheck
- type HealthStatus
- type ServerHealth
- type StringSet
Constants ¶
const ( PathHealth = "/health" PathProxyHealth = "/proxy/health" HealthStatusSuccess string = "success" HealthStatusError string = "error" )
const ( PathMetrics = "/metrics" PathProxyMetrics = "/proxy/metrics" )
Variables ¶
This section is empty.
Functions ¶
func HandleDebug ¶
func HandleHealth ¶
func HandleHealth(lg *zap.Logger, mux *http.ServeMux, srv ServerHealth)
HandleHealth registers metrics and health handlers. it checks health by using v3 range request and its corresponding timeout.
func HandleMetrics ¶
HandleMetrics registers prometheus handler on '/metrics'.
func HandleVersion ¶
func HandleVersion(mux *http.ServeMux, server etcdserver.Server)
func NewHealthHandler ¶
func NewHealthHandler(lg *zap.Logger, hfunc func(ctx context.Context, excludedAlarms StringSet, Serializable bool) Health) http.HandlerFunc
NewHealthHandler handles '/health' requests.
func NewPeerHandler ¶
func NewPeerHandler(lg *zap.Logger, s etcdserver.ServerPeerV2) http.Handler
NewPeerHandler generates an http.Handler to handle etcd peer requests.
Types ¶
type CheckRegistry ¶
type CheckRegistry struct {
// contains filtered or unexported fields
}
func (*CheckRegistry) InstallHTTPEndpoints ¶
func (reg *CheckRegistry) InstallHTTPEndpoints(lg *zap.Logger, mux *http.ServeMux)
func (*CheckRegistry) InstallHttpEndpoints
deprecated
func (reg *CheckRegistry) InstallHttpEndpoints(lg *zap.Logger, mux *http.ServeMux)
InstallHttpEndpoints installs the http handlers for the health checks.
Deprecated: Please use (*CheckRegistry) InstallHTTPEndpoints instead.
func (*CheckRegistry) Register ¶
func (reg *CheckRegistry) Register(name string, check HealthCheck)
func (*CheckRegistry) RootPath ¶
func (reg *CheckRegistry) RootPath() string
type Health ¶
Health defines etcd server health status. TODO: remove manual parsing in etcdctl cluster-health
type HealthCheck ¶
type HealthStatus ¶
HealthStatus is used in new /readyz or /livez health checks instead of the Health struct.
type ServerHealth ¶
type ServerHealth interface { Alarms() []*pb.AlarmMember Leader() types.ID Range(context.Context, *pb.RangeRequest) (*pb.RangeResponse, error) Config() config.ServerConfig AuthStore() auth.AuthStore }