VictoriaMetrics/app
Roman Khavronenko 38568254c5
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:56 +03:00
..
vmagent vmagent: expose metric vmagent_remotewrite_queues (#2871) (#3087) 2022-09-08 21:04:12 +03:00
vmalert vmalert: follow-up after 28441711e6 (#2972) 2022-08-30 12:04:51 +03:00
vmauth app/vmauth: do not remove trailing slash from the proxied path 2022-10-06 15:28:58 +03:00
vmbackup app: fix make publish-* after ed93330e66 2022-07-14 11:01:34 +03:00
vmbackupmanager docs: update -help output for vmbackup, vmbackupmanager, vmgateway and vmrestore components 2022-06-21 15:49:26 +03:00
vmctl app: fix make publish-* after ed93330e66 2022-07-14 11:01:34 +03:00
vmgateway docs: update -help output for vmbackup, vmbackupmanager, vmgateway and vmrestore components 2022-06-21 15:49:26 +03:00
vminsert app: fix make publish-* after ed93330e66 2022-07-14 11:01:34 +03:00
vmrestore app: fix make publish-* after ed93330e66 2022-07-14 11:01:34 +03:00
vmselect app/vmselect: ignore empty series for limit_offset (#3178) 2022-10-06 15:49:56 +03:00
vmstorage app: fix make publish-* after ed93330e66 2022-07-14 11:01:34 +03:00
vmui docs/CHANGELOG.md: document the 044d51b668 2022-08-30 11:28:20 +03:00