Documentation ¶
Overview ¶
Package alert provides Prometheus alerts, queries and access to Thanos and AlertManager stores.
Class ¶
There is a single class `alert:alert`.
Object ¶
An alert object is represented by this Go type. Rules starting from an alert should use the capitalized Go field names rather than the lowercase JSON names. Object
Query ¶
A JSON map of string names to string values, matched against alert labels, for example:
alert:alert:{"alertname":"KubeStatefulSetReplicasMismatch","container":"kube-rbac-proxy-main","namespace":"openshift-logging"}
Store ¶
A client of Prometheus and/or AlertManager. Store configuration:
domain: alert metrics: PROMETHEUS_URL alertmanager: ALERTMANAGER_URL
Either or both of `metrics` or `alertmanager` may be present.
Index ¶
Constants ¶
const ( StoreKeyMetrics = "metrics" StoreKeyAlertmanager = "alertmanager" )
Variables ¶
var Domain = domain{}
Functions ¶
Types ¶
type Class ¶
type Class struct{}
Class is represents any Prometheus alert. There is only a single class, named "alert".
func (Class) Description ¶ added in v0.1.2
type Object ¶
type Object struct { // Common fields. Labels map[string]string `json:"labels"` Annotations map[string]string `json:"annotations"` Status string `json:"status"` // inactive|pending|firing|suppressed StartsAt time.Time `json:"startsAt"` // Prometheus fields. Value string `json:"value"` Expression string `json:"expression"` Fingerprint string `json:"fingerprint"` // Alertmanager fields. EndsAt time.Time `json:"endsAt"` UpdatedAt time.Time `json:"updatedAt"` Receivers []Receiver `json:"receivers"` InhibitedBy []string `json:"inhibitedBy"` SilencedBy []string `json:"silencedBy"` GeneratorURL string `json:"generatorURL"` }
Object is represented by the JSON serialization the following type.
type Receiver ¶
type Receiver struct {
Name string `json:"name"`
}
Receiver is a named receiver, part of Object.