You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Tom Malaher (Jira)" <ji...@apache.org> on 2020/06/09 22:02:00 UTC

[jira] [Created] (KAFKA-10132) Kafka Connect JMX MBeans with String values have type double

Tom Malaher created KAFKA-10132:
-----------------------------------

             Summary: Kafka Connect JMX MBeans with String values have type double
                 Key: KAFKA-10132
                 URL: https://issues.apache.org/jira/browse/KAFKA-10132
             Project: Kafka
          Issue Type: Bug
          Components: KafkaConnect
    Affects Versions: 2.5.0
            Reporter: Tom Malaher


There are quite a few metrics available for source/sink connectors, and many of them are numeric (JMX type "double"), but there are a few attributes that have string values that are still tagged as "double".

For example:

Bean: kafka.connect:connector=my-source,type=connector-metrics Attribute: status

The Attribute Description says: "The status of the connector task. One of 'unassigned', 'running', 'paused', 'failed', or 'destroyed'."

The value is currently "running" on my instance.

This causes difficulty for anything that tries to introspect the JMX attribute metadata and then parse/display the data.

See also [https://stackoverflow.com/questions/50291157/which-jmx-metric-should-be-used-to-monitor-the-status-of-a-connector-in-kafka-co] where this problem is mentioned in one of the answers (dating back to 2018).

The attribute metadata should be updated to indicate the correct type.

I suspect the problem lies at line 220 of `org.apache.kafka.common.metrics.JmxReporter` (in version 2.5.0) where a hardcoded `double.class.getName()` is used as the mbean data type even for metrics with a type of String.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)