-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgrafana.go
39 lines (34 loc) · 970 Bytes
/
grafana.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
35
36
37
38
39
package handler
import "errors"
var ErrPayloadStateIsNotAlerting = errors.New("payload state is not alerting")
type AlertState string
const (
OK AlertState = "ok"
PAUSED AlertState = "paused"
ALERTING AlertState = "alerting"
PENDING AlertState = "pending"
NODATA AlertState = "no_data"
)
type WebhookPayload struct {
DashboardID int `json:"dashboardId"`
EvalMatches []struct {
Value interface{} `json:"value"`
Metric string `json:"metric"`
Tags struct {
Connector string `json:"connector"`
} `json:"tags"`
} `json:"evalMatches"`
OrgID int `json:"orgId"`
PanelID int `json:"panelId"`
RuleID int `json:"ruleId"`
RuleName string `json:"ruleName"`
RuleURL string `json:"ruleUrl"`
State AlertState `json:"state"`
Tags struct {
} `json:"tags"`
Title string `json:"title"`
ID string `json:"id"`
Ref string `json:"ref"`
Variables struct {
} `json:"variables"`
}