tillrohrmann commented on a change in pull request #10466: 
[FLINK-15110][metrics] Support variable exclusion
URL: https://github.com/apache/flink/pull/10466#discussion_r354909425
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/metrics/ReporterSetup.java
 ##########
 @@ -81,6 +84,19 @@ public ReporterSetup(final String name, final MetricConfig 
configuration, Metric
                return 
Optional.ofNullable(configuration.getString(ConfigConstants.METRICS_REPORTER_INTERVAL_SUFFIX,
 null));
        }
 
+       public Set<String> getExcludedVariables() {
+               String excludedVariablesList = 
configuration.getString(ConfigConstants.METRICS_REPORTER_EXCLUDED_VARIABLES, 
null);
+               if (excludedVariablesList == null) {
+                       return Collections.emptySet();
+               } else {
+                       final Set<String> excludedVariables = new HashSet<>();
+                       for (String exclusion : 
excludedVariablesList.split(";")) {
+                               
excludedVariables.add(ScopeFormat.asVariable(exclusion));
+                       }
+                       return Collections.unmodifiableSet(excludedVariables);
+               }
 
 Review comment:
   Could we use `ConfigOption<List<String>>` for the parsing of the excluded 
variables. I think the newly introduced typed config options could do this for 
us.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to