inhibit

package
v0.0.0-...-ce64a08 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: Apache-2.0 Imports: 11 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 label.Matchers
	// The set of Filters which define the group of target alerts (which are
	// inhibited by the source alerts).
	TargetMatchers label.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[label.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 profile.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 []profile.InhibitRule, mk alert.Marker) *Inhibitor

NewInhibitor returns a new Inhibitor.

func (*Inhibitor) Mutes

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

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

func (*Inhibitor) Start

func (ih *Inhibitor) Start(ctx context.Context) error

Start the Inhibitor's background processing.

func (*Inhibitor) Stop

func (ih *Inhibitor) Stop(ctx context.Context) error

Stop the Inhibitor's background processing.

Jump to

Keyboard shortcuts

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