Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 48CB6200B38 for ; Fri, 8 Jul 2016 17:57:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 47A0B160A36; Fri, 8 Jul 2016 15:57:13 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 71503160A77 for ; Fri, 8 Jul 2016 17:57:12 +0200 (CEST) Received: (qmail 80282 invoked by uid 500); 8 Jul 2016 15:57:11 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 80259 invoked by uid 99); 8 Jul 2016 15:57:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jul 2016 15:57:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 2639A2C02A7 for ; Fri, 8 Jul 2016 15:57:11 +0000 (UTC) Date: Fri, 8 Jul 2016 15:57:11 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-4184) Ganglia and GraphiteReporter report metric names with invalid characters MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 08 Jul 2016 15:57:13 -0000 [ 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)