inhibit

package
v0.0.0-...-a7839fa Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InhibitRule

type InhibitRule struct {
	// The set of Filters which define the group of source alerts (which inhibit
	// the target alerts).
	SourceMatchers labels.Matchers
	// The set of Filters which define the group of target alerts (which are
	// inhibited by the source alerts).
	TargetMatchers labels.Matchers
	// A set of label names whose label values need to be identical in source and
	// target alerts in order for the inhibition to take effect.
	Equal map[model.LabelName]struct{}
	// contains filtered or unexported fields
}

An InhibitRule specifies that a class of (source) alerts should inhibit notifications for another class of (target) alerts if all specified matching labels are equal between the two alerts. This may be used to inhibit alerts from sending notifications if their meaning is logically a subset of a higher-level alert.

func NewInhibitRule

func NewInhibitRule(cr *config.InhibitRule) *InhibitRule

NewInhibitRule returns a new InhibitRule based on a configuration definition.

type Inhibitor

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

An Inhibitor determines whether a given label set is muted based on the currently active alerts and a set of inhibition rules. It implements the Muter interface.

func NewInhibitor

func NewInhibitor(ap provider.Alerts, rs []*config.InhibitRule, mk types.Marker, logger log.Logger) *Inhibitor

NewInhibitor returns a new Inhibitor.

func (*Inhibitor) Mutes

func (ih *Inhibitor) Mutes(lset model.LabelSet) bool

Mutes returns true iff the given label set is muted. It implements the Muter interface.

func (*Inhibitor) Run

func (ih *Inhibitor) Run()

Run the Inhibitor's background processing.

func (*Inhibitor) Stop

func (ih *Inhibitor) Stop()

Stop the Inhibitor's background processing.

Jump to

Keyboard shortcuts

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