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.
0
votes
2 Answers
2
votes
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
0
votes
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