VictoriaMetrics/app/vmselect/promql
Roman Khavronenko 93fbd0c54b
promql: return step as scrapeInterval when it can't be calculated (#2865)
The change allows to specify default value for `getScrapeInterval`
function when actual interval can't be calculated.

Before the change, function were returning `maxSilenceInterval` (5m)
in such cases, which may be not correct for instant queries processing.
The specific scenario where using `maxSilenceInterval` caused issues
is the following:
1. Series becomes stale;
2. Client (in this case vmalert) continues to request series every 15s;
3. Database returns empty results as expected;
4. But at some specific moment of time database returns datapoints from `now()-5m`,
because lookback window was extended to `maxSilenceInterval`.

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2022-07-13 12:27:38 +03:00
..
active_queries.go app/vmselect: show X-Forwarded-For contents on /api/v1/status/active_queries page 2020-07-31 20:05:18 +03:00
aggr.go all: remove explicit "xxhash" name when importing github.com/cespare/xxhash/v2 package 2022-06-21 20:23:32 +03:00
aggr_incremental.go app/vmselect/promql: return empty values from group() if all the time series have no values at the given timestamp 2020-07-28 13:40:11 +03:00
aggr_incremental_test.go all: use %w instead of %s for wrapping errors in fmt.Errorf 2020-06-30 23:05:11 +03:00
aggr_test.go app/vmselect/promql: add mode() aggregate function 2020-07-20 15:31:20 +03:00
binary_op.go app/vmselect/promql: properly handle scalar default vector, scalar if vector and scalar ifnot vector queries 2022-04-21 15:34:36 +03:00
eval.go app/vmselect/promql: validate function name before evaluating its arguments 2022-07-12 19:48:26 +03:00
eval_test.go app/vmselect/promql: optimize queries, which join on _info metrics. 2022-01-31 19:32:36 +02:00
exec.go all: add initial support for query tracing 2022-06-01 02:29:23 +03:00
exec_test.go metricsql: properly evaluate timezone_offset over time interval (#2842) 2022-07-08 14:03:56 +03:00
memory_limiter.go app/vmselect/promql: use dynamic limit on memory for concurrent queries 2019-06-12 23:18:44 +03:00
memory_limiter_test.go app/vmselect/promql: use dynamic limit on memory for concurrent queries 2019-06-12 23:18:44 +03:00
parser.go app/vmselect: accept optional extra_filters[] query args for all the supported Prometheus querying APIs 2021-12-06 17:07:09 +02:00
rollup.go promql: return step as scrapeInterval when it can't be calculated (#2865) 2022-07-13 12:27:38 +03:00
rollup_result_cache.go all: readability improvements for query traces 2022-06-30 18:20:33 +03:00
rollup_result_cache_test.go all: add initial support for query tracing 2022-06-01 02:29:23 +03:00
rollup_test.go app/vmselect/promql: properly handle partial counter resets in rate(), irate(), increase() and remove_resets() functions 2022-06-30 22:39:38 +03:00
rollup_timing_test.go all: open-sourcing single-node version 2019-05-23 00:18:06 +03:00
timeseries.go lib/bytesutil: split Resize* funcs to MayOverallocate and NoOverallocate for more fine-grained control over memory allocations 2022-02-01 00:18:42 +02:00
timeseries_test.go app/vmselect/promql: store compressed results in the cache 2019-08-14 02:29:45 +03:00
transform.go metricsql: properly evaluate timezone_offset over time interval (#2842) 2022-07-08 14:03:56 +03:00
transform_test.go app/vmselect: make fmt after f3ece83e67 2022-07-05 14:35:24 +03:00
tzdata.go all: add go:build lines for Go1.17 2021-07-26 15:48:21 +03:00