From ddedeb1d425eab545ea0036086a42e484288b61a Mon Sep 17 00:00:00 2001 From: hagen1778 Date: Thu, 26 Oct 2023 15:41:35 +0200 Subject: [PATCH] app/vmalert: remove unclear comment The timestamp alignment should be applied as a last step to keep the timestamp consistent. Signed-off-by: hagen1778 --- app/vmalert/rule/group.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/vmalert/rule/group.go b/app/vmalert/rule/group.go index 9369b43f13..ec03d9aa58 100644 --- a/app/vmalert/rule/group.go +++ b/app/vmalert/rule/group.go @@ -594,10 +594,9 @@ func (g *Group) adjustReqTimestamp(timestamp time.Time) time.Time { return ts } - // account for delay before adjusting the timestamp. - // otherwise, the alignment may be off if `delay!=g.Interval` timestamp = timestamp.Add(-g.getEvalDelay()) + // always apply the alignment as a last step if g.evalAlignment == nil || *g.evalAlignment { // align query time with interval to get similar result with grafana when plotting time series. // see https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5049