简体   繁体   中英

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. Like Prometheus JMX exporter.

You expose JMX by exporting a variable before starting it

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

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

You can setup local/remote monitoring of kafka rest proxy using jconsole.

# 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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