0

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.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Mohamed Zouari
  • 395
  • 1
  • 5
  • 14
  • Can you please clarify why you're not using Prometheus or Jolokia? Also, how is this question any different than any other Java process? – OneCricketeer Mar 12 '20 at 13:54

2 Answers2

2

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

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
0

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>

enter image description here Reference: https://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html

jaym
  • 470
  • 1
  • 6
  • 17