简体   繁体   English

如何通过 JMX 访问 Kafka 休息代理指标

[英]How to access to Kafka rest proxy metrics through JMX

I am trying to build my own metrics collector from the rest server, I need to access to a variety of metrics through JMX, to gather data, scrape and expose mBeans of the jmx server.我正在尝试从其余服务器构建自己的指标收集器,我需要通过 JMX 访问各种指标,以收集数据、抓取和公开 jmx 服务器的 mBean。 Like Prometheus JMX exporter.像 Prometheus JMX 导出器。

You expose JMX by exporting a variable before starting it通过在启动之前导出变量来公开 JMX

export JMX_PORT=9001 # for example 
kafka-rest-start config.properties 

https://github.com/confluentinc/kafka-rest/blob/v5.4.1/bin/kafka-rest-run-class#L52 https://github.com/confluentinc/kafka-rest/blob/v5.4.1/bin/kafka-rest-run-class#L52

Similarly, rather than create your own non-industry standard solution, just use the Prometheus JMX exporter or Jolokia JMX agent and scrape it into the format you're interested in同样,不要创建自己的非行业标准解决方案,只需使用 Prometheus JMX 导出器或 Jolokia JMX 代理并将其刮成您感兴趣的格式

You can setup local/remote monitoring of kafka rest proxy using jconsole.您可以使用 jconsole 设置本地/远程监控 kafka 休息代理。

# local monitoring
$ jconsole <process-id-of-kafka-rest-proxy>
# remote monitoring
$ jconsole <host:port>

在此处输入图片说明 Reference: https://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html参考: https : //docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM