You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2020/07/26 00:59:10 UTC

[skywalking] branch prom-rule-reg created (now bf9c5ec)

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a change to branch prom-rule-reg
in repository https://gitbox.apache.org/repos/asf/skywalking.git.


      at bf9c5ec  Support regular expression in labelFilter

This branch includes the following new commits:

     new bf9c5ec  Support regular expression in labelFilter

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[skywalking] 01/01: Support regular expression in labelFilter

Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch prom-rule-reg
in repository https://gitbox.apache.org/repos/asf/skywalking.git

commit bf9c5ec99bb2072c36d64c2dfb62f69b0dacd7d4
Author: Gao Hongtao <ha...@gmail.com>
AuthorDate: Sun Jul 26 08:58:53 2020 +0800

    Support regular expression in labelFilter
---
 .../oap/server/core/metric/promethues/PrometheusMetricConverter.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/metric/promethues/PrometheusMetricConverter.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/metric/promethues/PrometheusMetricConverter.java
index fc7631c..8e50f50 100644
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/metric/promethues/PrometheusMetricConverter.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/metric/promethues/PrometheusMetricConverter.java
@@ -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))
             )