有没有一种方法可以配置要使用jmx_exporter/prometheus捕获的kafka-connect jmx指标? [英] Is there a way to configure kafka-connect jmx metrics to be captured using a jmx_exporter/prometheus?

查看:802
本文介绍了有没有一种方法可以配置要使用jmx_exporter/prometheus捕获的kafka-connect jmx指标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我们的Kafka生态系统中设置对Kafka Connect的监视.我已经为kafka经纪人启用了JMX导出器,并且工作正常.现在,我正在尝试为kafka connect启用JMX导出器.但是,尚不清楚从哪里开始.

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.

我只能修改connect-distributed.sh以启用更改.任何指针都将是一个很好的补充.

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

kafka-run-class.sh进行了修改,以使jmx_exporter能够在http://<host>:9304/metrics上发出jmx指标

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

我希望一旦启用jmx_exporter,kafka-connect就会在http://<host>:19000/metrics上发出指标.

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

推荐答案

强烈建议不要修改bin目录中的脚本.将Kafka升级到下一版本时,提取新的二进制文件将覆盖脚本中所做的更改.

Modifying a script in the bin directory is highly unrecommended. When upgrading Kafka to the next version, extracting the new binaries would override the changes made in the script.

首选方法应该是在脚本之外设置环境变量KAFKA_JMX_OPTS:

The preferred way should be to set the environment variable KAFKA_JMX_OPTS outside the script:

export KAFKA_JMX_OPTS =-javaagent:/opt/kafka/libs/jmx_prometheus_javaagent-0.12.0.jar=127.0.0.1:10902:/etc/kafka-connect/jmx_exporter.yaml"

export KAFKA_JMX_OPTS="-javaagent:/opt/kafka/libs/jmx_prometheus_javaagent-0.12.0.jar=127.0.0.1:10902:/etc/kafka-connect/jmx_exporter.yaml"

如果在通过脚本启动Kafka之前设置了var,它将使用var代替/bin/kafka-server-start.sh

If the var is set before starting Kafka via the script it will use the var instead of the default values defined in /bin/kafka-server-start.sh

如何为Kafka设置Java选项 ?

这篇关于有没有一种方法可以配置要使用jmx_exporter/prometheus捕获的kafka-connect jmx指标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆