prometheus/model/relabel
Bryan Boreham 0289dd6157 relabel: blank replacement deletes label post-regexp
If `cfg.TargetLabel` is a template like `$1`, it won't match any labels,
so no point calling `lb.Del` with it.

Similarly if `target` is not a valid label name, it won't match any
labels, so don't call with that either.

The intention seems to have been that a blank _value_ would delete the
target, so change that code to use `target` instead of `cfg.TargetLabel`.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
2023-12-18 16:39:01 +00:00
..
relabel_test.go relabel: blank replacement deletes label post-regexp 2023-12-18 16:39:01 +00:00
relabel.go relabel: blank replacement deletes label post-regexp 2023-12-18 16:39:01 +00:00