fix: wrong alerting time range
This commit is contained in:
parent
709536cd5d
commit
ca546bd503
|
@ -949,12 +949,10 @@ func newParameterCtx(rule *alerting.Rule, checkResults *alerting.ConditionResult
|
||||||
max = checkResults.QueryResult.Max
|
max = checkResults.QueryResult.Max
|
||||||
if v, ok := min.(int64); ok {
|
if v, ok := min.(int64); ok {
|
||||||
//expand 60s
|
//expand 60s
|
||||||
v = v - int64(time.Second * 60)
|
min = time.UnixMilli(v).Add(-time.Second*60).UTC().Format("2006-01-02T15:04:05.999Z")
|
||||||
min = time.Unix(v/1000, v%1000 * 1e5).UTC().Format("2006-01-02T15:04:05.999Z")
|
|
||||||
}
|
}
|
||||||
if v, ok := max.(int64); ok {
|
if v, ok := max.(int64); ok {
|
||||||
v = v + int64(time.Second * 60)
|
max = time.UnixMilli(v).Add(time.Second*60).UTC().Format("2006-01-02T15:04:05.999Z")
|
||||||
max = time.Unix(v/1000, v%1000 * 1e5).UTC().Format("2006-01-02T15:04:05.999Z")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
paramsCtx := util.MapStr{
|
paramsCtx := util.MapStr{
|
||||||
|
|
Loading…
Reference in New Issue