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

 ##########
 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:
   no, because MetricConfig is based on `Properties` and can't implement 
`ReadableConfig` since flink-metrics has no dependency on flink-core for 
historic reasons. It is a truly independent module.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to