kezhenxu94 commented on code in PR #9822:
URL: https://github.com/apache/skywalking/pull/9822#discussion_r1001505680
##########
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:
let's also take `.yml` into consideration, it's also valid extension name of
yaml
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]