I have an application that has a lot of useless metrics that I want to weed out before scraping.
The metrics that are useless have label_one
and label_two
that do not match.
metric_to_keep{ label_one="identical-value", label_two="identical-value" }
metric_to_drop{ label_one="different-value", label_two="value-is-different" }
I thought I had a great solution by using this bit of regex
:
- source_labels: [label1, label2]
action: drop
regex: ^(.+);\1
However, apparently: \1 backreference (NOT SUPPORTED)
error parsing regexp: invalid escape sequence: `\\1`
Is there a way for me to accomplish this task?