From ba99e26a3a197b7b5a15bbed2de39397360e75ed Mon Sep 17 00:00:00 2001 From: liugq Date: Wed, 9 Aug 2023 19:06:08 +0800 Subject: [PATCH] format min, max to adapter frontend --- service/alerting/elasticsearch/engine.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/service/alerting/elasticsearch/engine.go b/service/alerting/elasticsearch/engine.go index e152524c..6e7e3f2d 100644 --- a/service/alerting/elasticsearch/engine.go +++ b/service/alerting/elasticsearch/engine.go @@ -937,6 +937,12 @@ func newParameterCtx(rule *alerting.Rule, checkResults *alerting.ConditionResult if checkResults.QueryResult != nil { min = checkResults.QueryResult.Min max = checkResults.QueryResult.Max + if v, ok := min.(int64); ok { + min = time.Unix(v/1000, v%1000 * 1e5).UTC().Format("2006-01-02T15:04:05.999Z") + } + if v, ok := max.(int64); ok { + max = time.Unix(v/1000, v%1000 * 1e5).UTC().Format("2006-01-02T15:04:05.999Z") + } } paramsCtx := util.MapStr{ alerting2.ParamRuleID: rule.ID,