Support regular expression in labelFilter (#5174)
Co-authored-by: 吴晟 Wu Sheng <wu.sheng@foxmail.com>
This commit is contained in:
parent
fea685d7cd
commit
a49ce988b4
|
|
@ -118,7 +118,8 @@ public class PrometheusMetricConverter {
|
|||
return true;
|
||||
}
|
||||
return rule._3.getLabelFilter().stream()
|
||||
.allMatch(matchRule -> matchRule.getOptions().contains(metric.getLabels().get(matchRule.getKey())));
|
||||
.allMatch(matchRule -> matchRule.getOptions().stream()
|
||||
.anyMatch(metric.getLabels().get(matchRule.getKey())::matches));
|
||||
})
|
||||
.map(rule -> Tuple.of(rule._1, rule._2, rule._3, metric))
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue