From ec589c4703c3e6a3262f21d9652709135f57451d Mon Sep 17 00:00:00 2001 From: zhaoxiangchun <1422928955@qq.com> Date: Fri, 29 Jan 2021 18:13:57 +0800 Subject: [PATCH] fix(monitor): fix alert notify info do not contain resourceName --- pkg/monitor/alerting/conditions/query.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/monitor/alerting/conditions/query.go b/pkg/monitor/alerting/conditions/query.go index e00f78cdb0..ea8285413f 100644 --- a/pkg/monitor/alerting/conditions/query.go +++ b/pkg/monitor/alerting/conditions/query.go @@ -99,6 +99,9 @@ func (c *QueryCondition) filterTags(tags map[string]string, details monitor.Comm if _, ok := ret["ip"]; !ok { ret["ip"] = tags["host_ip"] } + if _, ok := ret["name"]; !ok { + ret["name"] = tags["host"] + } for _, tag := range []string{"brand", "platform", "hypervisor"} { if val, ok := ret[tag]; ok { ret["brand"] = val