monitoring

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(c HTTPMonitoringConfig, l log.Logger, leader LeaderChecker, healthers map[string]Healther) *httpserver.HTTPServer

func RegisterHTTPMonitoring

func RegisterHTTPMonitoring(c HTTPMonitoringConfig, l log.Logger, leader LeaderChecker, healthers map[string]Healther) chi.Router

Types

type HTTPHealthMonitoring

type HTTPHealthMonitoring struct {
	httpserver.HTTPResponder
	// contains filtered or unexported fields
}

func NewHTTPHealthMonitoring

func NewHTTPHealthMonitoring(healther Healther, leader LeaderChecker, c HTTPMonitoringConfig, l log.Logger) HTTPHealthMonitoring

func (HTTPHealthMonitoring) HandleIsHealthy

func (a HTTPHealthMonitoring) HandleIsHealthy(w http.ResponseWriter, r *http.Request)

type HTTPLeaderMonitoring

type HTTPLeaderMonitoring struct {
	httpserver.HTTPResponder
	// contains filtered or unexported fields
}

func NewHTTPLeaderMonitoring

func NewHTTPLeaderMonitoring(leader LeaderChecker, l log.Logger) HTTPLeaderMonitoring

func (HTTPLeaderMonitoring) HandleIsLeader

func (a HTTPLeaderMonitoring) HandleIsLeader(w http.ResponseWriter, r *http.Request)

type HTTPMonitoringConfig

type HTTPMonitoringConfig struct {
	Clusters                     []string
	Endpoint                     string
	HealthStatusExpirationPeriod time.Duration
}

type HealthStatus

type HealthStatus struct {
	ModificationTime time.Time
	Err              error
}

type Healther

type Healther interface {
	GetHealthStatus() HealthStatus
}

Healther incapsulates logic about health checking.

type LeaderChecker

type LeaderChecker interface {
	// IsLeader returns whether app is running controllers or not.
	IsLeader() bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL