未验证 提交 a49ce988 编写于 作者: G Gao Hongtao 提交者: GitHub

Support regular expression in labelFilter (#5174)

Co-authored-by: wu-sheng's avatar吴晟 Wu Sheng <wu.sheng@foxmail.com>
上级 fea685d7
......@@ -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))
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册