alerts

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PromClient

type PromClient struct {
	// contains filtered or unexported fields
}

PromClient is a wrapper around the Prometheus Client interface and implements the api This way, the PromClient can be instantiated with the configuration the Client needs, and the ability to use the methods the api has, like Query and so on.

func NewPromClient

func NewPromClient(conf papi.Config) (*PromClient, error)

NewPromClient creates a new client to the Prometheus API. It returns an error on any problem.

func (*PromClient) ActiveAlerts

func (p *PromClient) ActiveAlerts(filter *regexp.Regexp, firingOnly bool) ([]string, error)

ActiveAlerts is a method of type PromClient, it returns a list of names of active alerts (e.g. pending or firing), filtered by the supplied regexp or by the includeLabels query. filter by regexp means when the regex finds the alert-name; the alert is exluded from the block-list and will NOT block rebooting. query by includeLabel means, if the query finds an alert, it will include it to the block-list and it WILL block rebooting.

Jump to

Keyboard shortcuts

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