Is there a way to configure kafka-connect jmx metrics to be captured using a jmx_exporter/prometheus?

蓝咒 提交于 2020-01-06 06:42:29

问题


I'm setting up monitoring for Kafka connect in our Kafka ecosystem. I have enabled JMX exporter for kafka brokers and is working fine. Now I am trying to enable JMX exporter for kafka connect. However, it is a bit unclear where to start.

I can only modify connect-distributed.sh to enable the change. Any pointers would be a great addition.

kafka-run-class.sh was modified to enable jmx_exporter to emit jmx metrics on http://<host>:9304/metrics

I expect kafka-connect to emit metrics on http://<host>:19000/metrics once the jmx_exporter has been enabled.


回答1:


Digging around I have found a solution to the issue. Java agent can be added to the connect-distributed.sh and starts to emit the metrics nicely.

So enable jmx_exporter on Kafka Connect framework

  1. Open connect-distributed.sh
  2. Modify the last line which calls the kafka-run-class.sh
exec $(dirname $0)/kafka-run-class.sh $EXTRA_ARGS org.apache.kafka.connect.cli.ConnectDistributed "$@"

to the following

exec $(dirname $0)/kafka-run-class.sh $EXTRA_ARGS -javaagent:/path/to/jmx_prometheus_javaagent-0.11.0.jar=9408:/path/to/config/file/prometheus.yml org.apache.kafka.connect.cli.ConnectDistributed "$@"


来源:https://stackoverflow.com/questions/56835399/is-there-a-way-to-configure-kafka-connect-jmx-metrics-to-be-captured-using-a-jmx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!