VictoriaMetrics/app/vmselect
Roman Khavronenko f68333a8ce
app/vmselect: ignore empty series for limit_offset (#3178)
* app/vmselect: ignore empty series for `limit_offset`

VictoriaMetrics doesn't return empty series (with all NaN values) to
the user. But such series are filtered after transform functions.
It means `limit_offset` will account for empty series as well.

For example, let's consider following data set:
```
time series:
foo{label="1"} NaN, NaN, NaN, NaN // empty series
foo{label="2"} 1, 2, 3, 4
foo{label="3"} 4, 3, 2, 1
```

When user requests all series for metric `foo` the empty series
will be filtered out:
```
/query=foo:
foo{label="v2"} 1, 2, 3, 4
foo{label="v3"} 4, 3, 2, 1
```

But `limit_offset(1, 1, foo)` is applied to original series, not filtered yet.
So it will return `foo{label="v2"}` (skips the first in list)
```
/query=limit_offset(1, 1, foo):
foo{label="v2"} 1, 2, 3, 4
```

Expected result would be to apply `limit_offset` to already filtered list,
so in result we receive `foo{label="v3"}`:
```
/query=limit_offset(1, 1, foo):
foo{label="v3"} 4, 3, 2, 1
```

The change does exactly that - filters empty series before applying `limit_offset`.

Signed-off-by: hagen1778 <roman@victoriametrics.com>

* app/vmselect: ignore empty series for `limit_offset`

Signed-off-by: hagen1778 <roman@victoriametrics.com>

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2022-10-06 15:49:34 +03:00
..
bufferedwriter app/vmselect: do not export NaN values for stale metrics at /federate endpoint 2022-10-06 15:18:33 +03:00
graphite lib/vmselectapi: pass maxSuffixes arg to tagValueSuffixes RPC call 2022-07-06 12:37:54 +03:00
graphiteql Graphite vmalert wip (#112) 2021-02-01 15:05:32 +02:00
netstorage app/vmselect/netstorage: optimize mergeSortBlocks() for the worst case when blocks contain interleaved samples 2022-07-12 12:31:38 +03:00
prometheus app/vmselect: do not export NaN values for stale metrics at /federate endpoint 2022-10-06 15:18:33 +03:00
promql app/vmselect: ignore empty series for limit_offset (#3178) 2022-10-06 15:49:34 +03:00
querystats app/vmselect: do not track queries with less than 1ms execution time at /api/v1/status/top_queries 2021-07-15 16:44:28 +03:00
searchutils all: make fmt via the upcoming Go1.19 2022-07-11 19:22:15 +03:00
vmui vmui: optimize table view (#2867) 2022-07-14 00:15:43 +03:00
main.go app/{vmselect,vmalert}: properly generate http redirects if -http.pathPrefix command-line flag is set 2022-08-08 15:41:14 +03:00
README.md app/vmui: move source code from https://github.com/VictoriaMetrics/vmui to app/vmui 2021-07-09 17:15:23 +03:00

vmselect performs the incoming queries and fetches the required data from vmstorage.

The vmui directory contains static contents built from app/vmui package with make vmui-update command. The vmui page is available at http://<victoria-metrics>:8428/vmui/.