Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-10132

Kafka Connect JMX MBeans with String values have type double

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 2.5.0
    • None
    • connect

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              RensGroothuijsen Rens Groothuijsen
              tmalaher Tom Malaher
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: