MCPcopy Create free account
hub / github.com/prometheus/common / Alert

Struct Alert

model/alert.go:30–42  ·  view source on GitHub ↗

Alert is a generic representation of an alert in the Prometheus eco-system.

Source from the content-addressed store, hash-verified

28
29// Alert is a generic representation of an alert in the Prometheus eco-system.
30type Alert struct {
31 // Label value pairs for purpose of aggregation, matching, and disposition
32 // dispatching. This must minimally include an "alertname" label.
33 Labels LabelSet `json:"labels"`
34
35 // Extra key/value information which does not define alert identity.
36 Annotations LabelSet `json:"annotations"`
37
38 // The known time range for this alert. Both ends are optional.
39 StartsAt time.Time `json:"startsAt,omitempty"`
40 EndsAt time.Time `json:"endsAt,omitempty"`
41 GeneratorURL string `json:"generatorURL"`
42}
43
44// Name returns the name of the alert. It is equivalent to the "alertname" label.
45func (a *Alert) Name() string {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected