Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Alert ¶
type Alert struct { model.Alert // The authoritative timestamp. UpdatedAt time.Time Timeout bool WasSilenced bool `json:"-"` WasInhibited bool `json:"-"` }
Alert wraps a model.Alert with additional information relevant to internal of the Alertmanager. The type is never exposed to external communication and the embedded alert has to be sanitized beforehand.
type AlertSlice ¶
type AlertSlice []*Alert
AlertSlice is a sortable slice of Alerts.
func (AlertSlice) Len ¶
func (as AlertSlice) Len() int
func (AlertSlice) Less ¶
func (as AlertSlice) Less(i, j int) bool
func (AlertSlice) Swap ¶
func (as AlertSlice) Swap(i, j int)
type Marker ¶
type Marker interface { SetInhibited(alert model.Fingerprint, b bool) SetSilenced(alert model.Fingerprint, sil ...string) Silenced(alert model.Fingerprint) (string, bool) Inhibited(alert model.Fingerprint) bool }
Marker helps to mark alerts as silenced and/or inhibited. All methods are goroutine-safe.
type Matcher ¶
type Matcher struct { Name string `json:"name"` Value string `json:"value"` IsRegex bool `json:"isRegex"` // contains filtered or unexported fields }
Matcher defines a matching rule for the value of a given label.
func NewMatcher ¶
NewMatcher returns a new matcher that compares against equality of the given value.
func NewRegexMatcher ¶
NewRegexMatcher returns a new matcher that compares values against a regular expression. The matcher is already initialized.
TODO(fabxc): refactor usage.
func (*Matcher) Init ¶ added in v0.5.0
Init internals of the Matcher. Must be called before using Match.
type Matchers ¶
type Matchers []*Matcher
Matchers provides the Match and Fingerprint methods for a slice of Matchers. Matchers must always be sorted.
func NewMatchers ¶ added in v0.5.0
NewMatchers returns the given Matchers sorted.
func (Matchers) Fingerprint ¶
func (ms Matchers) Fingerprint() model.Fingerprint
Fingerprint returns a quasi-unique fingerprint for the matchers.
type MultiError ¶
type MultiError struct {
// contains filtered or unexported fields
}
MultiError contains multiple errors and implements the error interface. Its zero value is ready to use. All its methods are goroutine safe.
func (*MultiError) Error ¶
func (e *MultiError) Error() string
func (*MultiError) Errors ¶
func (e *MultiError) Errors() []error
Errors returns the errors added to the MuliError. The returned slice is a copy of the internal slice of errors.
func (*MultiError) Len ¶
func (e *MultiError) Len() int
Len returns the number of errors added to the MultiError.
type Silence ¶
type Silence struct { // A unique identifier across all connected instances. ID string `json:"id"` // A set of matchers determining if a label set is affect // by the silence. Matchers Matchers `json:"matchers"` // Time range of the silence. // // * StartsAt must not be before creation time // * EndsAt must be after StartsAt // * Deleting a silence means to set EndsAt to now // * Time range must not be modified in different ways // // TODO(fabxc): this may potentially be extended by // creation and update timestamps. StartsAt time.Time `json:"startsAt"` EndsAt time.Time `json:"endsAt"` // The last time the silence was updated. UpdatedAt time.Time `json:"updatedAt"` // Information about who created the silence for which reason. CreatedBy string `json:"createdBy"` Comment string `json:"comment,omitempty"` // contains filtered or unexported fields }
A Silence determines whether a given label set is muted.
func (*Silence) Deleted ¶ added in v0.5.0
Deleted returns whether a silence is deleted. Semantically this means it had no effect on history at any point.
func (*Silence) Init ¶ added in v0.5.0
Init initializes a silence. Must be called before using Mutes.