/
types.go
34 lines (27 loc) · 949 Bytes
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package types
import (
alertmanagertemplate "github.com/prometheus/alertmanager/template"
)
// Alert is an alert received from the Alertmanager
type Alert = alertmanagertemplate.Alert
// Alerts is a set of alerts received from the Alertmanager
type Alerts = alertmanagertemplate.Alerts
// AlertsData is the alerts object received from the Alertmanager
type AlertsData = alertmanagertemplate.Data
// AlertBucket mutualizes alerts by Trap IDs
type AlertBucket struct {
AlertGroups map[string]*AlertGroup
}
// AlertGroup type, with OID and group ID
type AlertGroup struct {
OID string
GroupID string
GroupLabels map[string]string
CommonLabels map[string]string
CommonAnnotations map[string]string
Severity string
Alerts []Alert
DeclaredAlerts []Alert
}
// GetAlertGroupName allows to retrieve a group name from a given alert
type GetAlertGroupName func(Alert) (*string, error)