diff --git a/pkg/monitor/alerting/conditions/query.go b/pkg/monitor/alerting/conditions/query.go index 7a7c2257e9..0c63883ca0 100644 --- a/pkg/monitor/alerting/conditions/query.go +++ b/pkg/monitor/alerting/conditions/query.go @@ -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) { diff --git a/pkg/monitor/alerting/rule.go b/pkg/monitor/alerting/rule.go index cf017ffa5c..3859a47865 100644 --- a/pkg/monitor/alerting/rule.go +++ b/pkg/monitor/alerting/rule.go @@ -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) }