fix(monitor): fix monitor process alert

修复进程监控报警后,没有触发前端报警提示的问题
This commit is contained in:
zhaoxiangchun
2021-06-30 09:46:44 +08:00
parent fd2e0f7ddf
commit 9c6d0b8252
2 changed files with 8 additions and 1 deletions
+3 -1
View File
@@ -532,7 +532,9 @@ func (c *QueryCondition) setResType() {
}
}
}
c.ResType = resType
if c.Query.Model.Database == monitor.METRIC_DATABASE_TELE {
c.ResType = resType
}
}
func (c *QueryCondition) GetQueryResources() ([]jsonutils.JSONObject, error) {
+5
View File
@@ -190,6 +190,11 @@ func newRuleDescription(rule *Rule, alertDetails *monitor.CommonAlertMetricDetai
ConditionType: alertDetails.ConditionType,
},
}
if len(ruleDes.ResType) == 0 {
if alertDetails.DB == monitor.METRIC_DATABASE_TELE {
ruleDes.ResType = monitor.METRIC_RES_TYPE_HOST
}
}
rule.RuleDescription = append(rule.RuleDescription, &ruleDes)
}