From 50e2524bc2a3750a1f20e221993f0b2cf8939460 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=A0=E5=BF=83=E9=9B=B6=E5=BA=A6?= <97019752@qq.com> Date: Mon, 5 Sep 2022 16:51:32 +0800 Subject: [PATCH] api prometheus/api/v1/label/../values time not specified, (#3052) modify default start values --- app/vmselect/prometheus/prometheus.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/vmselect/prometheus/prometheus.go b/app/vmselect/prometheus/prometheus.go index c5ec39e6b..6b1876ed8 100644 --- a/app/vmselect/prometheus/prometheus.go +++ b/app/vmselect/prometheus/prometheus.go @@ -1072,12 +1072,13 @@ func getExportParams(r *http.Request, startTime time.Time) (*commonParams, error // - extra_filters[] func getCommonParams(r *http.Request, startTime time.Time, requireNonEmptyMatch bool) (*commonParams, error) { deadline := searchutils.GetDeadlineForQuery(r, startTime) - start, err := searchutils.GetTime(r, "start", 0) + ct := startTime.UnixNano() / 1e6 + start, err := searchutils.GetTime(r, "start", ct-3*defaultStep) if err != nil { return nil, err } - ct := startTime.UnixNano() / 1e6 end, err := searchutils.GetTime(r, "end", ct) + if err != nil { return nil, err }