[ 
https://issues.apache.org/jira/browse/FLINK-4184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15367871#comment-15367871
 ] 

ASF GitHub Bot commented on FLINK-4184:
---------------------------------------

Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2220#discussion_r70097230
  
    --- Diff: 
flink-core/src/main/java/org/apache/flink/metrics/reporter/AbstractReporter.java
 ---
    @@ -84,4 +84,24 @@ public void notifyOfRemovedMetric(Metric metric, String 
metricName, AbstractMetr
        protected String replaceInvalidChars(String metricName) {
                return metricName;
        }
    +
    +   /**
    +    * Method which constructs the fully qualified metric name from the 
metric group and the metric
    +    * name.
    +    *
    +    * @param metricName Name of the metric
    +    * @param group Associated metric group
    +    * @return Fully qualified metric name
    +    */
    +   private String constructMetricName(String metricName, 
AbstractMetricGroup group) {
    +           StringBuilder builder = new StringBuilder();
    +
    +           for (String componentName : group.getScopeComponents()) {
    +                   
builder.append(replaceInvalidChars(componentName)).append(".");
    --- End diff --
    
    this is a bit inefficient. The output of this loop is identical for all 
metrics on that group, yet is computed for every single metric. Instead you 
could modify the getScopeString() method to accept a charFilter argument that 
is passed into ScopeFormat.concat().


> Ganglia and GraphiteReporter report metric names with invalid characters
> ------------------------------------------------------------------------
>
>                 Key: FLINK-4184
>                 URL: https://issues.apache.org/jira/browse/FLINK-4184
>             Project: Flink
>          Issue Type: Bug
>          Components: Metrics
>    Affects Versions: 1.1.0
>            Reporter: Till Rohrmann
>            Assignee: Till Rohrmann
>             Fix For: 1.1.0
>
>
> Flink's {{GangliaReporter}} and {{GraphiteReporter}} report metrics with 
> names which contain invalid characters. For example, quotes are not filtered 
> out which can be problematic for Ganglia. Moreover, dots are not replaced 
> which causes Graphite to think that an IP address is actually a scoped metric 
> name.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to