You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Guozhang Wang (JIRA)" <ji...@apache.org> on 2018/12/14 00:04:00 UTC

[jira] [Created] (KAFKA-7734) Metrics tags should use LinkedHashMap to guarantee ordering

Guozhang Wang created KAFKA-7734:
------------------------------------

             Summary: Metrics tags should use LinkedHashMap to guarantee ordering
                 Key: KAFKA-7734
                 URL: https://issues.apache.org/jira/browse/KAFKA-7734
             Project: Kafka
          Issue Type: Improvement
          Components: metrics
            Reporter: Guozhang Wang


Today we store metrics tags inside MetricName from various places, and many of them are using `HashMap`. However, for metrics reporters like JMXReporter, the mBeanName is constructed by looping over `metricName.tags().entrySet()` which does not guarantee ordering. This resulted a few places where the mBeanName string not as expected, e.g. we document the Streams cache metrics as 

{code}
kafka.streams:type=stream-record-cache-metrics,client-id=([-.\w]+),task-id=([-.\w]+),record-cache-id=([-.\w]+)
{code}

However, what I've seen from JMXReporter is, for example:

{code}
kafka.streams:type=stream-record-cache-metrics,record-cache-id=all,client-id=streams-saak-test-client-StreamThread-1,task-id=1_3
{code}



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