-
Notifications
You must be signed in to change notification settings - Fork 6
/
alert.go
31 lines (28 loc) · 1.11 KB
/
alert.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
package main
import (
"time"
)
// Message is the JSON message sent by Prometheus Alertmanager, see
// https://prometheus.io/docs/alerting/configuration/#webhook_config for
// documentation on fields.
type Message struct {
Version string `json:"version"`
GroupKey string `json:"groupKey"`
Status string `json:"status"`
Receiver string `json:"receiver"`
GroupLabels map[string]string `json:"groupLabels"`
CommonLabels map[string]string `json:"commonLabels"`
CommonAnnotations map[string]string `json:"commonAnnotations"`
ExternalURL string `json:"externalURL"`
Alerts []*Alert `json:"alerts"`
}
// Alert is contained in a Message
type Alert struct {
Parent *Message `json:"-"`
Status string `json:"status"`
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations"`
StartsAt time.Time `json:"startsAt"`
EndsAt time.Time `json:"endsAt"`
GeneratorURL string `json:"generatorURL"`
}