Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct {
// ID is the ID of the alert.
ID string
// Name is the name of the alert.
Name string
// StartsAt is when the alert has been started.
StartsAt time.Time
// End is when the alert has been ended.
EndsAt time.Time
// Status is the status of the alert.
Status AlertStatus
// Labels is data that defines the alert.
Labels map[string]string
// Annotations is a simple map of values that can be used to
// add more info to the alert but don't define the alert nature
// commonly this is used to add description, titles...
Annotations map[string]string
// GeneratorURL is the url that generated the alert (eg. Prometheus metrics).
GeneratorURL string
}
Alert represents an alert.
type AlertGroup ¶
type AlertGroup struct {
// ID is the group of alerts ID.
ID string
// Labels are the labels of the group.
Labels map[string]string
// Alerts are all the alerts in the group (firing, resolved, unknown...).
Alerts []Alert
}
AlertGroup is a group of alerts that share some of the information like the state, common metadata... and can be grouped in order to notify at the same time.
func (AlertGroup) FiringAlerts ¶ added in v0.3.2
func (a AlertGroup) FiringAlerts() []Alert
FiringAlerts returns the firing alerts.
func (AlertGroup) HasFiring ¶ added in v0.3.2
func (a AlertGroup) HasFiring() bool
HasFiring returns true if it has firing alerts.
func (AlertGroup) HasResolved ¶ added in v0.3.2
func (a AlertGroup) HasResolved() bool
HasResolved returns true if it has resolved alerts.
func (AlertGroup) ResolvedAlerts ¶ added in v0.3.2
func (a AlertGroup) ResolvedAlerts() []Alert
ResolvedAlerts returns the resolved alerts.
type AlertStatus ¶
type AlertStatus int
AlertStatus is the status of an alert.
const ( // AlertStatusUnknown is unknown alert status. AlertStatusUnknown AlertStatus = iota // AlertStatusFiring is when the alert is active and firing. AlertStatusFiring // AlertStatusResolved is when the alert was being triggered and now // is not being triggered anymore. AlertStatusResolved )
Click to show internal directories.
Click to hide internal directories.