fix(region): adjust the query range corresponding to the alarm strategy

The data in the cycle range may not be available yet, and the data in the last hour can be queried fixedly
This commit is contained in:
rainzm
2021-08-20 11:11:36 +08:00
parent 3b0c73a550
commit 70864334d9
+1 -1
View File
@@ -338,7 +338,7 @@ func (sa *SScalingAlarm) generateAlertConfig(sp *SScalingPolicy) (*monitor.Alert
case api.OPERATOR_GT:
cond = cond.GT(sa.Value)
}
q := cond.Query().From(fmt.Sprintf("%ds", sa.Cycle))
q := cond.Query().From("1h")
sel := q.Selects().Select(indicatorMap[sa.Indicator].Field)
switch sa.Wrapper {
case api.WRAPPER_AVER: