I'm using the following jmx metrics for kafka connect.
Have a look at Connect Monitoring section in the Kafka docs, it lists all the Kafka Connect specific metrics.
For example there are overall metrics for each connector:
kafka.connect:type=connector-metrics,connector="{connector}"
which contains a connector status (running, failed, etc)kafka.connect:type=connector-task-metrics,connector="{connector}",task="{task}"
which contains the status of individual tasks
If you want more than just the status, there are also additional metrics for both sink and source tasks:
kafka.connect:type=connector-task-metrics,connector="{connector}",task="{task}"
kafka.connect:type=sink-task-metrics,connector="{connector}",task="{task}"
connector-task-metrics, sink-task-metrics
are now visible but still connector-metrics
which contains the connector status and what I was looking for is not present. Any suggestions what I could be missing? –
Chisel I still don't have enough rep to comment but I can answer...
Elaborating on Mickael's answer, be careful: currently task metrics disappear when a task is in a failed state rather than show up with the FAILED status. A Jira can be found here and PR can be found here
Connector status is available under kafka.connect:type=connector-metrics. With jmxterm, you may notice that the attributes are described as doubles instead of strings:
$>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;
This resulted in WARN logs from my monitoring agent:
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)
Each monitoring system may have different fixes, but I suspect the cause may be the same?
© 2022 - 2024 — McMap. All rights reserved.