Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertPostCommApi ¶
type AlertPostCommApi struct { Title string `json:"title,omitempty"` Msg string `json:"msg"` StarTs string `json:"startsTs,omitempty"` EndTs string `json:"endTs,omitempty"` Labels KV `json:"labels,omitempty"` Values map[string]float64 `json:"values,omitempty"` }
func PromeAlertToAlertPostCommApi ¶
func PromeAlertToAlertPostCommApi(alert alertTemplate.Alert, zone string) AlertPostCommApi
func (*AlertPostCommApi) ReportCC ¶
func (api *AlertPostCommApi) ReportCC()
type GrafanaEvalMatch ¶
type GrafanaWebhook ¶
type GrafanaWebhook struct { Title string `json:"title"` State string `json:"state"` Msg string `json:"message"` EvalMatches []*GrafanaEvalMatch `json:"evalMatches"` }
func (*GrafanaWebhook) GrafanaWebhookToAlertPostCommApi ¶
func (alert *GrafanaWebhook) GrafanaWebhookToAlertPostCommApi(zone string) []*AlertPostCommApi
type KV ¶
'{ "title": "CPU告警", // 可选,标题信息 "msg":"CPU异常告警。", // 必选,通知信息 "labels":{ // 必选,标签信息 "cmdb_type" : "host", // 可选,api的内部标签协议动态匹配 "cmdb_name": "yw_prometheus" }, "url": "" // 可选,待定 }'
KV is a set of key/value string pairs.
type PromeAlerts ¶
type PromeAlerts alertTemplate.Data
func (*PromeAlerts) Firing ¶
func (p *PromeAlerts) Firing(zone string) []AlertPostCommApi
func (*PromeAlerts) Resolved ¶
func (p *PromeAlerts) Resolved(zone string) []AlertPostCommApi
Click to show internal directories.
Click to hide internal directories.