healthmonitor

package
v0.3.61 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdHealthMonitor

type EtcdHealthMonitor struct {

	// Time after which we consider instances to be down if no metrics have been collected successfully.
	// Defaults to 2 minutes.
	MetricsMaxAge time.Duration
	// Interval at which to scrape metrics from etcd.
	// Defaults to 5 second.
	ScrapeInterval time.Duration
	// contains filtered or unexported fields
}

EtcdHealthMonitor is a service for monitoring the health of etcd. It continually scrapes metrics from one of more etcd instances and provides a method for checking the fraction of storage in use.

func NewEtcdHealthMonitor

func NewEtcdHealthMonitor(etcConfiguration configuration.EtcdConfiguration, client *http.Client) (*EtcdHealthMonitor, error)

Return a new EtcdHealthMonitor that monitors the etcd instances at the given urls. Provide a http client, e.g., to use auth, or set client to nil to use the default client.

func (*EtcdHealthMonitor) Collect

func (srv *EtcdHealthMonitor) Collect(metrics chan<- prometheus.Metric)

func (*EtcdHealthMonitor) Describe

func (srv *EtcdHealthMonitor) Describe(desc chan<- *prometheus.Desc)

func (*EtcdHealthMonitor) IsWithinHardHealthLimit

func (srv *EtcdHealthMonitor) IsWithinHardHealthLimit() bool

func (*EtcdHealthMonitor) IsWithinSoftHealthLimit

func (srv *EtcdHealthMonitor) IsWithinSoftHealthLimit() bool

func (*EtcdHealthMonitor) Run

func (srv *EtcdHealthMonitor) Run(ctx context.Context)

Run the service until ctx is cancelled.

type EtcdLimitHealthMonitor

type EtcdLimitHealthMonitor interface {
	IsWithinSoftHealthLimit() bool
	IsWithinHardHealthLimit() bool
}

type FakeEtcdLimitHealthMonitor

type FakeEtcdLimitHealthMonitor struct {
	IsWithinSoftLimit bool
	IsWithinHardLimit bool
}

func (*FakeEtcdLimitHealthMonitor) IsWithinHardHealthLimit

func (f *FakeEtcdLimitHealthMonitor) IsWithinHardHealthLimit() bool

func (*FakeEtcdLimitHealthMonitor) IsWithinSoftHealthLimit

func (f *FakeEtcdLimitHealthMonitor) IsWithinSoftHealthLimit() bool

Jump to

Keyboard shortcuts

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