From e352cb7fa1a54172e40c5f43eeaa8e48015ae363 Mon Sep 17 00:00:00 2001 From: liugq Date: Wed, 25 May 2022 19:03:48 +0800 Subject: [PATCH] add rule name --- plugin/api/alerting/message.go | 1 + plugin/api/alerting/rule.go | 1 + 2 files changed, 2 insertions(+) diff --git a/plugin/api/alerting/message.go b/plugin/api/alerting/message.go index f9296ed1..25ea5c5d 100644 --- a/plugin/api/alerting/message.go +++ b/plugin/api/alerting/message.go @@ -256,6 +256,7 @@ func (h *AlertAPI) getAlertMessage(w http.ResponseWriter, req *http.Request, ps detailObj := util.MapStr{ "message_id": message.ID, "rule_id": message.RuleID, + "rule_name": rule.Name, "title": message.Title, "message": message.Message, "severity": message.Severity, diff --git a/plugin/api/alerting/rule.go b/plugin/api/alerting/rule.go index f0ecb1b8..6cc054be 100644 --- a/plugin/api/alerting/rule.go +++ b/plugin/api/alerting/rule.go @@ -182,6 +182,7 @@ func (alertAPI *AlertAPI) getRuleDetail(w http.ResponseWriter, req *http.Request } detailObj := util.MapStr{ + "rule_name": obj.Name, "resource_name": obj.Resource.Name, "resource_objects": obj.Resource.Objects, "period_interval": obj.Metrics.PeriodInterval, //统计周期