Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertData ¶
type AlertData struct {
Receiver string `json:"receiver"`
Status string `json:"status"`
Alerts []*AlertRule `json:"alerts"`
GroupLabels *GroupLabel `json:"groupLabels"`
CommonLabels *CommonLabel `json:"commonLabels"`
CommonAnnotations *CommonAnnotation `json:"commonAnnotations"`
ExternalURL string `json:"externalURL"`
Version string `json:"version"`
GroupKey string `json:"groupKey"`
TruncatedAlerts int `json:"truncatedAlerts"`
}
{
"receiver": "告警统计",
"status": "firing",
"alerts": [{
"status": "firing",
"labels": {
"alertname": "STAGE-环境Kong实例挂掉了",
"groupname": "map[:/usr/local/kong]",
"idc": "STAGE",
"instance": "40.2",
"ip": "40.2",
"job": "process",
"people": "许宗超",
"resolved_summary": "STAGE-环境Kong实例已恢复运行!",
"response": "立即响应处理",
"service": "kong",
"severity": "高"
},
"annotations": {
"description": "STAGE-环境Kong实例已经挂掉将近一分钟!",
"summary": "STAGE-环境Kong实例挂掉了!"
},
"startsAt": "2023-02-01T06:25:07.057207341Z",
"endsAt": "0001-01-01T00:00:00Z",
"generatorURL": "http://optimus20a3:9090/graph?g0.expr=namedprocess_namegroup_num_procs%7Bgroupname%3D%22map%5B%3A%2Fusr%2Flocal%2Fkong%5D%22%2Cidc%3D%22STAGE%22%7D+%3D%3D+0\u0026g0.tab=1",
"fingerprint": "d37b7bae8f00f452"
}],
"groupLabels": {
"alertname": "STAGE-环境Kong实例挂掉了",
"ip": "40.2"
},
"commonLabels": {
"alertname": "STAGE-环境Kong实例挂掉了",
"groupname": "map[:/usr/local/kong]",
"idc": "STAGE",
"instance": "40.2",
"ip": "40.2",
"job": "process",
"people": "许宗超",
"resolved_summary": "STAGE-环境Kong实例已恢复运行!",
"response": "立即响应处理",
"service": "kong",
"severity": "高"
},
"commonAnnotations": {
"description": "STAGE-环境Kong实例已经挂掉将近一分钟!",
"summary": "STAGE-环境Kong实例挂掉了!"
},
"externalURL": "http://optimus20a6:9093",
"version": "4",
"groupKey": "{}:{alertname=\"STAGE-环境Kong实例挂掉了\", ip=\"40.2\"}",
"truncatedAlerts": 0
}
func NewDefaultAlert ¶
func NewDefaultAlert() *AlertData
type Annotation ¶
type CommonAnnotation ¶
type CommonLabel ¶
type CommonLabel struct {
Alertname string `json:"alertname"`
Groupname string `json:"groupname"`
Idc string `json:"idc"`
Instance string `json:"instance"`
IP string `json:"ip"`
Job string `json:"job"`
People string `json:"people"`
ResolvedSummary string `json:"resolved_summary"`
Response string `json:"response"`
Service string `json:"service"`
Severity string `json:"severity"`
}
type GroupLabel ¶
type Label ¶
type Label struct {
Alertname string `json:"alertname"`
Groupname string `json:"groupname"`
Idc string `json:"idc"`
Instance string `json:"instance"`
IP string `json:"ip"`
Job string `json:"job"`
People string `json:"people"`
ResolvedSummary string `json:"resolved_summary"`
Response string `json:"response"`
Service string `json:"service"`
Severity string `json:"severity"`
}
Click to show internal directories.
Click to hide internal directories.