You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "David Brinegar (JIRA)" <ji...@apache.org> on 2019/03/10 23:25:00 UTC

[jira] [Commented] (KAFKA-3881) Remove the replacing logic from "." to "_" in Fetcher

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

David Brinegar commented on KAFKA-3881:
---------------------------------------

We recently came across this bug noticing the discrepancy in fetcher metrics with everything else, if you have a topic with a dot in the name. It looks like the original code in [https://github.com/apache/kafka/pull/939] was following a pattern to prefix and normalize tags, but then backed out the prefix while leaving the normalization. So it would seem a mistake. In any case, other topic tags throughout the client do not do this conversion of dot to underbar.

One can look at Sender.java
 
{code:java}
 Map<String, String> metricTags = Collections.singletonMap("topic", topic);   {code}
Partition.scala
{code:java}
private val tags = Map("topic" -> topic, "partition" -> partitionId.toString)
{code}
Log.scala
{code:java}
Map("topic" -> topicPartition.topic, "partition" -> topicPartition.partition.toString) ++ maybeFutureTag{code}
and so on, it would seem Fetcher.java is alone in this hard coded conversion, while all the other metric collectors use the plain topic string as-is.
 

> Remove the replacing logic from "." to "_" in Fetcher
> -----------------------------------------------------
>
>                 Key: KAFKA-3881
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3881
>             Project: Kafka
>          Issue Type: Bug
>          Components: consumer, metrics
>            Reporter: Guozhang Wang
>            Assignee: Tom Bentley
>            Priority: Major
>              Labels: newbie, patch-available
>
> The logic of replacing "." to "_" in metrics names / tags was originally introduced in the core package's metrics since Graphite treats "." as hierarchy separators (see KAFKA-1902); for the client metrics, it is supposed that the GraphiteReported should take care of this itself rather than letting Kafka metrics to special handle for it. In addition, right now only consumer Fetcher had replace, but producer Sender does not have it actually.
> So we should consider removing this logic in the consumer Fetcher's metrics package. NOTE that this is a public API backward incompatible change.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)