From 5ae47e8940a67fdd232ebe9b73698965ce9750c2 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 19 Nov 2019 00:41:13 +0200 Subject: [PATCH] app/vmselect/prometheus: properly adjust too big time `time` on `/api/v1/query` Too big `time` must be adjusted to `now()-queryOffset`. --- app/vmselect/prometheus/prometheus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/vmselect/prometheus/prometheus.go b/app/vmselect/prometheus/prometheus.go index 5993e13610..46bf576c94 100644 --- a/app/vmselect/prometheus/prometheus.go +++ b/app/vmselect/prometheus/prometheus.go @@ -555,7 +555,7 @@ func QueryHandler(at *auth.Token, w http.ResponseWriter, r *http.Request) error return fmt.Errorf(`too long query; got %d bytes; mustn't exceed %d bytes`, len(query), *maxQueryLen) } if ct-start < queryOffset { - start -= queryOffset + start = ct - queryOffset } if childQuery, windowStr, offsetStr := promql.IsMetricSelectorWithRollup(query); childQuery != "" { var window int64