prometheus/pkg/labels
Cyril Tovena c751cfbfce
Improve findSetMatches to support concatenation.
This improves how we find `SetMatches` for regexp. Notably it allows to support concatenation
such as `api_(v1|prom)_push` for which the resulting set matches are `api_v1_push` and `api_prom_push`.

I had to support characters classes too since the syntax may try to optimize alternates with them.

In the end the code is also more robust than the previous implementation relying on the stringyfied version of the regexp.

This could be upstreamed later.

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
2021-10-05 13:43:41 +02:00
..
labels.go labels: Reduce allocated memory and latency of Hash method; Added tests. (#8025) 2020-10-15 11:31:28 +01:00
labels_test.go Benchmark Labels.Get() and document the result (#9242) 2021-08-24 16:35:19 +05:30
matcher.go Improve findSetMatches to support concatenation. 2021-10-05 13:43:41 +02:00
matcher_test.go Use global string map for MatchType.String() (#9237) 2021-08-24 11:26:16 +05:30
regexp.go Improve findSetMatches to support concatenation. 2021-10-05 13:43:41 +02:00
regexp_test.go Improve findSetMatches to support concatenation. 2021-10-05 13:43:41 +02:00
test_utils.go Port tsdb to use pkg/labels. (#6326) 2019-11-18 11:53:33 -08:00