应该使用哪个jmx指标来监控kafka connect中连接器的状态?

时间:2018-05-11 11:18:04

标签: apache-kafka jmx metrics apache-kafka-connect

我使用以下jmx metrics进行kafka连接。

2 个答案:

答案 0 :(得分:1)

我仍然没有足够的代表发表评论,但是我可以回答...

详细说明Mickael的答案,要小心:当任务处于失败状态而不是显示为FAILED状态时,当前任务指标消失Jira can be found herePR can be found here

答案 1 :(得分:0)

连接器状态在kafka.connect:type = connector-metrics下可用。 使用jmxterm,您可能会注意到属性被描述为双精度而不是字符串:

$>info
#mbean = kafka.connect:connector=dev-kafka-connect-mssql,type=connector-metrics
#class name = org.apache.kafka.common.metrics.JmxReporter$KafkaMbean
# attributes
  %0   - connector-class (double, r)
  %1   - connector-type (double, r)
  %2   - connector-version (double, r)
  %3   - status (double, r)

$>get status
#mbean = kafka.connect:connector=dev-kafka-connect-mssql,type=connector-metrics:
status = running;

这导致来自我的监控代理的WARN日志:

    2018-05-23 14:35:53,966 | WARN | JMXAttribute | Unable to get metrics from kafka.connect:type=connector-metrics,connector=dev-kafka-connect-rabbitmq-orders - status
java.lang.NumberFormatException: For input string: "running"
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
        at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
        at java.lang.Double.parseDouble(Double.java:538)
        at org.datadog.jmxfetch.JMXAttribute.castToDouble(JMXAttribute.java:270)
        at org.datadog.jmxfetch.JMXSimpleAttribute.getMetrics(JMXSimpleAttribute.java:32)
        at org.datadog.jmxfetch.JMXAttribute.getMetricsCount(JMXAttribute.java:226)
        at org.datadog.jmxfetch.Instance.getMatchingAttributes(Instance.java:332)
        at org.datadog.jmxfetch.Instance.init(Instance.java:193)
        at org.datadog.jmxfetch.App.instantiate(App.java:604)
        at org.datadog.jmxfetch.App.init(App.java:658)
        at org.datadog.jmxfetch.App.main(App.java:140)

每个监控系统可能有不同的修复,但我怀疑原因可能相同?