fix(monitor): fix nodata alertresource list

1.修复nodata报警资源列表无法根据nodata策略正确刷新和删除
This commit is contained in:
--global
2020-12-23 14:44:11 +08:00
parent 8b4f01e02e
commit f408ef0275
@@ -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
}