[ https://issues.apache.org/jira/browse/FLINK-8080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16282445#comment-16282445 ]
ASF GitHub Bot commented on FLINK-8080: --------------------------------------- Github user greghogan commented on a diff in the pull request: https://github.com/apache/flink/pull/5099#discussion_r155620220 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/metrics/MetricRegistryConfiguration.java --- @@ -108,15 +118,36 @@ public static MetricRegistryConfiguration fromConfiguration(Configuration config delim = '.'; } - final String definedReporters = configuration.getString(MetricOptions.REPORTERS_LIST); + Set<String> includedReporters = reporterListPattern.splitAsStream(configuration.getString(MetricOptions.REPORTERS_LIST, "")) + .collect(Collectors.toSet()); + + // use a TreeSet to make the reporter order deterministic, which is useful for testing + Set<String> namedReporters = new TreeSet<>(String::compareTo); + // scan entire configuration for "metric.reporter" keys and parse individual reporter configurations + for (String key : configuration.keySet()) { + if (key.startsWith(ConfigConstants.METRICS_REPORTER_PREFIX)) { + Matcher matcher = reporterClassPattern.matcher(key); + if (matcher.matches()) { + String reporterName = matcher.group(1); + if (includedReporters.isEmpty() || includedReporters.contains(reporterName)) { + if (namedReporters.contains(reporterName)) { + LOG.warn("Duplicate class configuration detected for reporter {}.", reporterName); + } else { + namedReporters.add(reporterName); + } + } else { + LOG.info("Excluding reporter {}.", reporterName); --- End diff -- Log the reason for excluding the reporter (not in the reporters list)? > Remove need for "metrics.reporters" > ----------------------------------- > > Key: FLINK-8080 > URL: https://issues.apache.org/jira/browse/FLINK-8080 > Project: Flink > Issue Type: Improvement > Components: Configuration, Metrics > Reporter: Chesnay Schepler > Assignee: Chesnay Schepler > Priority: Trivial > Fix For: 1.5.0 > > > Currently, in order to use a reporter one must configure something like this: > {code} > metrics.reporters: jmx > metrics.reporter.jmx.class: ... > {code} > It would be neat if users did not have to set {{metrics.reporters}}. We can > accomplish this by a scanning the configuration for configuration keys > starting with {{metrics.reporter.}} and using the next word as a reporter > name. -- This message was sent by Atlassian JIRA (v6.4.14#64029)