You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/10/21 08:28:19 UTC

[GitHub] [skywalking] yswdqz commented on a diff in pull request #9822: Change the way of loading MAL rules

yswdqz commented on code in PR #9822:
URL: https://github.com/apache/skywalking/pull/9822#discussion_r1001514186


##########
oap-server/analyzer/meter-analyzer/src/main/java/org/apache/skywalking/oap/meter/analyzer/prometheus/rule/Rules.java:
##########
@@ -47,29 +49,70 @@ public static List<Rule> loadRules(final String path) throws ModuleStartExceptio
     public static List<Rule> loadRules(final String path, List<String> enabledRules) throws ModuleStartException {
         File[] rules;
         try {
-            rules = ResourceUtils.getPathFiles(path);
+            rules = ResourceUtils.getAllPathFiles(path);
         } catch (FileNotFoundException e) {
             throw new ModuleStartException("Load fetcher rules failed", e);
         }
+        final List<String> formedEnabledRules =
+                enabledRules
+                        .stream()
+                        .map(rule -> rule.endsWith(".yaml") ? rule : rule + ".yaml")

Review Comment:
   Got it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org