rgroothuijsen commented on a change in pull request #9078:
URL: https://github.com/apache/kafka/pull/9078#discussion_r571647298



##########
File path: 
clients/src/main/java/org/apache/kafka/common/metrics/JmxReporter.java
##########
@@ -272,8 +272,16 @@ public MBeanInfo getMBeanInfo() {
             for (Map.Entry<String, KafkaMetric> entry : 
this.metrics.entrySet()) {
                 String attribute = entry.getKey();
                 KafkaMetric metric = entry.getValue();
+                String metricType = double.class.getName();
+
+                try {
+                    metricType = metric.metricValue().getClass().getName();
+                } catch (NullPointerException e) {

Review comment:
       @jeqo Thanks, moving the initialization did make a difference, 
specifically after moving it past [this 
point](https://github.com/apache/kafka/blob/8e211eb72f9a45897cc37fed394a38096aa47feb/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/DistributedHerder.java#L232).
   
   This did lead to an opposite problem, though, as now other exceptions start 
appearing. From what I can tell, `WorkerGroupMember` and `HerderMetrics` are 
dependent on each other, so I'm getting errors in one or the other when I 
change the ordering around.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to