VictoriaMetrics/app
Roman Khavronenko 273472dc20
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-09-30 08:44:05 +03:00
..
vmagent lib/promrelabel: add SanitizeName() function for sanitizing Prometheus metric names and label names 2022-09-28 10:02:11 +03:00
vmalert vmalert: allow using extra labels in annotations (#3181) 2022-09-30 07:48:59 +03:00
vmauth lib/{httpserver,netutil}: allow to define min and max TLS version of the http server (#3109) 2022-09-26 17:38:43 +03:00
vmbackup lib/{httpserver,netutil}: allow to define min and max TLS version of the http server (#3109) 2022-09-26 17:38:43 +03:00
vmbackupmanager lib/{httpserver,netutil}: allow to define min and max TLS version of the http server (#3109) 2022-09-26 17:38:43 +03:00
vmctl lib/promrelabel: add SanitizeName() function for sanitizing Prometheus metric names and label names 2022-09-28 10:02:11 +03:00
vmgateway lib/{httpserver,netutil}: allow to define min and max TLS version of the http server (#3109) 2022-09-26 17:38:43 +03:00
vminsert lib/promrelabel: add SanitizeName() function for sanitizing Prometheus metric names and label names 2022-09-28 10:02:11 +03:00
vmrestore lib/{httpserver,netutil}: allow to define min and max TLS version of the http server (#3109) 2022-09-26 17:38:43 +03:00
vmselect app/vmselect: ignore empty series for limit_offset (#3178) 2022-09-30 08:44:05 +03:00
vmstorage app/vmstorage: expose vm_{hourly,daily}_series_limit_{max,current}_series metrics if -storage.max{Hourly,Daily}Series limits are set 2022-08-24 13:41:57 +03:00
vmui vmui: fix query params saving in URL (#3104) 2022-09-13 19:19:57 +03:00