private static Rule getRulesFromFile(String ruleName, Path path) {
        File file = path.toFile();
        if (!file.isFile() || file.isHidden()) {
            return null;
        }
        try (Reader r = new FileReader(file)) {
            Rule rule = new Yaml().loadAs(r, Rule.class);
            if (rule == null) {
                return null;
            }
            rule.setName(ruleName);
            return rule;
        } catch (IOException e) {
            throw new UnexpectedException("Load rule file" + file.getName() + " failed", e);
        }
    }
Rules is factory to instance {@link Rule} from a local file.
oap-server/analyzer/meter-analyzer/src/main/java/org/apache/skywalking/oap/meter/analyzer/prometheus/rule/Rules.java