Documentation
¶
Overview ¶
Package alertmanager holds alerts, alert groups and silences in Alertmanager's formats. The service replaced Alertmanager (see the router package) but keeps its formats: rule engines post alerts in its API v2 form, and the bridge takes groups the way its webhook delivered them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
Status string `json:"status"`
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations"`
StartsAt time.Time `json:"startsAt"`
EndsAt time.Time `json:"endsAt"`
GeneratorURL string `json:"generatorURL"`
Fingerprint string `json:"fingerprint"`
}
Alert is one alert in a group.
type Matcher ¶
type Matcher struct {
Name string `json:"name"`
Value string `json:"value"`
IsRegex bool `json:"isRegex"`
IsEqual bool `json:"isEqual"`
}
Matcher is a label matcher.
type Silence ¶
type Silence struct {
ID string `json:"id"`
Matchers []Matcher `json:"matchers"`
StartsAt time.Time `json:"startsAt"`
EndsAt time.Time `json:"endsAt"`
CreatedBy string `json:"createdBy"`
Comment string `json:"comment"`
Status struct {
State string `json:"state"` // active, pending, expired
} `json:"status"`
}
Silence is a silence as the API lists it.
type Webhook ¶
type Webhook struct {
Version string `json:"version"`
GroupKey string `json:"groupKey"`
TruncatedAlerts int `json:"truncatedAlerts"`
Status string `json:"status"` // firing or resolved
Receiver string `json:"receiver"`
GroupLabels map[string]string `json:"groupLabels"`
CommonLabels map[string]string `json:"commonLabels"`
CommonAnnotations map[string]string `json:"commonAnnotations"`
ExternalURL string `json:"externalURL"`
Alerts []Alert `json:"alerts"`
}
Webhook is an alert group as Alertmanager's webhook delivered it (version 4).