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

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

Github user ex00 commented on the issue:

    https://github.com/apache/flink/pull/2517
  
    Could you explain me how must look API for getting metric identifier?
    Now I think  about this:
    ```java
    @Test
    public void testConfigurableDelimiterForReporter() {
                Configuration config = new Configuration();
                config.setString(ConfigConstants.METRICS_REPORTERS_LIST, 
"test1");
                config.setString(ConfigConstants.METRICS_SCOPE_DELIMITER, ".");
                config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + 
"test1." + ConfigConstants.METRICS_REPORTER_SCOPE_DELIMITER, "_");
                config.setString(ConfigConstants.METRICS_REPORTER_PREFIX + 
"test1." + ConfigConstants.METRICS_REPORTER_CLASS_SUFFIX, 
TestReporter.class.getName());
                config.setString(ConfigConstants.METRICS_SCOPE_NAMING_TM, 
"A.B.C.D.E");
    
                MetricRegistry registry = new MetricRegistry(config);
    
                TaskManagerMetricGroup tmGroup = new 
TaskManagerMetricGroup(registry, "host", "id");
                assertEquals("A.B.C.D.E.name", 
tmGroup.getMetricIdentifier("name")); //get default delimiter for all
                assertEquals("A_B_C_D_E_name", 
tmGroup.getMetricIdentifier("name",null,1)); //get delimiter for first reporter 
in list
                registry.shutdown();
        }
    ```



> [metrics] Delimiter should be configured per reporter
> -----------------------------------------------------
>
>                 Key: FLINK-4564
>                 URL: https://issues.apache.org/jira/browse/FLINK-4564
>             Project: Flink
>          Issue Type: Bug
>          Components: Metrics
>    Affects Versions: 1.1.0
>            Reporter: Chesnay Schepler
>            Assignee: Anton Mushin
>
> Currently, the delimiter used or the scope string is based on a configuration 
> setting shared by all reporters. However, different reporters may have 
> different requirements in regards to the delimiter, as such we should allow 
> reporters to use a different delimiter.
> We can keep the current setting as a global setting that is used if no 
> specific setting was set.



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

Reply via email to