From f408ef027555080bd2098e1b8d93ee1878fd4fdd Mon Sep 17 00:00:00 2001 From: --global <1422928955@qq.com> Date: Wed, 23 Dec 2020 14:44:11 +0800 Subject: [PATCH] fix(monitor): fix nodata alertresource list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.修复nodata报警资源列表无法根据nodata策略正确刷新和删除 --- pkg/monitor/alerting/conditions/nodataquery.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/monitor/alerting/conditions/nodataquery.go b/pkg/monitor/alerting/conditions/nodataquery.go index d6df040a41..d3dd2d4e9b 100644 --- a/pkg/monitor/alerting/conditions/nodataquery.go +++ b/pkg/monitor/alerting/conditions/nodataquery.go @@ -201,14 +201,12 @@ func (c *NoDataQueryCondition) createEvalMatchTagFromHostJson(evalContext *alert evalMatch.Tags[HOST_TAG_BRAND] = brand switch evalContext.Rule.RuleDescription[0].ResType { - case monitor.METRIC_RES_TYPE_HOST: - evalMatch.Tags[hostconsts.TELEGRAF_TAG_KEY_RES_TYPE] = hostconsts.TELEGRAF_TAG_ONECLOUD_RES_TYPE - evalMatch.Tags[hostconsts.TELEGRAF_TAG_KEY_HOST_TYPE] = hostconsts.TELEGRAF_TAG_ONECLOUD_HOST_TYPE_HOST case monitor.METRIC_RES_TYPE_GUEST: case monitor.METRIC_RES_TYPE_RDS: case monitor.METRIC_RES_TYPE_REDIS: case monitor.METRIC_RES_TYPE_OSS: default: + evalMatch.Tags["host"] = name evalMatch.Tags[hostconsts.TELEGRAF_TAG_KEY_RES_TYPE] = hostconsts.TELEGRAF_TAG_ONECLOUD_RES_TYPE evalMatch.Tags[hostconsts.TELEGRAF_TAG_KEY_HOST_TYPE] = hostconsts.TELEGRAF_TAG_ONECLOUD_HOST_TYPE_HOST }