...

Package inhibit

import "github.com/prometheus/alertmanager/inhibit"
Overview
Index

Overview ▾

type InhibitRule

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.

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
}

func NewInhibitRule

func NewInhibitRule(cr *config.InhibitRule) *InhibitRule

NewInhibitRule returns a new InhibitRule based on a configuration definition.

type Inhibitor

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.

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

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.