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.