VictoriaMetrics/lib/promrelabel
Zakhar Bessarab 58e5238e63
lib/promrelabel: fix relabeling if clause (#4816)
* lib/promrelabel: fix relabeling if clause being applied to labels outside of current context

Relabeling is applied to each metric row separately, but in order to lower amount of memory allocations it is reusing labels.

Functions which are working on current metric row labels are supposed to use only current metric labels by using provided offset, but if clause matcher was using the whole labels set instead of local metrics.

This leaded to invalid relabeling results such as one described here: https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4806

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>

* docs/CHANGELOG.md: document the bugfix

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1998
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4806

---------

Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
2023-08-12 08:38:04 -07:00
..
testdata lib/promrelabel: support action: graphite relabeling 2022-06-16 20:25:49 +03:00
config.go lib/promrelabel: do not split regex into multiple lines if it contains groups 2022-08-08 15:39:24 +03:00
config_test.go lib/promrelabel: fix expected test result (#2957) 2022-08-08 16:29:46 +03:00
graphite.go lib/promrelabel: support action: graphite relabeling 2022-06-16 20:25:49 +03:00
graphite_test.go lib/promrelabel: support action: graphite relabeling 2022-06-16 20:25:49 +03:00
graphite_timing_test.go lib/promrelabel: support action: graphite relabeling 2022-06-16 20:25:49 +03:00
if_expression.go lib/promrelabel: support action: graphite relabeling 2022-06-16 20:25:49 +03:00
if_expression_test.go lib/promrelabel: support action: graphite relabeling 2022-06-16 20:25:49 +03:00
relabel.go lib/promrelabel: fix relabeling if clause (#4816) 2023-08-12 08:38:04 -07:00
relabel_test.go lib/promrelabel: support action: graphite relabeling 2022-06-16 20:25:49 +03:00
relabel_timing_test.go app/{vmagent,vminsert}: follow-up after 2fe045e2a4 2021-06-04 20:33:22 +03:00
sort.go lib/promscrape: optimize getScrapeWork() function 2022-04-20 15:34:18 +03:00
sort_test.go app/vmagent: initial implementation for vmagent 2020-02-23 17:31:54 +02:00