Documentation ¶
Overview ¶
Package alertmanager defines structures and primitives to support Alertmanager's webhook API.
Shamelessly ripped from github.com/prometheus/alertmanager/template/template.go to avoid a huge dependency tree,
Index ¶
Constants ¶
View Source
const ( // AlertNameLabel is the name of the label containing the an alert's name. AlertNameLabel = "alertname" // AlertFiring is the status value for a firing alert. AlertFiring = "firing" // AlertResolved is the status value for a resolved alert. AlertResolved = "resolved" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { Status string `json:"status"` Labels KV `json:"labels"` Annotations KV `json:"annotations"` StartsAt time.Time `json:"startsAt"` EndsAt time.Time `json:"endsAt"` GeneratorURL string `json:"generatorURL"` }
Alert holds one alert for notification templates.
type Data ¶
type Data struct { // The protocol version. Version string `json:"version"` GroupKey string `json:"groupKey"` Receiver string `json:"receiver"` Status string `json:"status"` Alerts Alerts `json:"alerts"` GroupLabels KV `json:"groupLabels"` CommonLabels KV `json:"commonLabels"` CommonAnnotations KV `json:"commonAnnotations"` ExternalURL string `json:"externalURL"` }
Data is the data passed to notification templates and webhook pushes.
End-users should not be exposed to Go's type system, as this will confuse them and prevent simple things like simple equality checks to fail. Map everything to float64/string.
Click to show internal directories.
Click to hide internal directories.