I am fairly new to kafka and was exploring on collecting kafka metrics. In my exploring I was able to collect the metrics with help of JMX and Jconsole but the thing is due to some reason I am not allowed to enable JMX port so the prospect of using prometheus or grafana is out as per my understanding. Now I was wondering if there is another way of collecting the metrics without using JMX with the help of REST Api or something. I also looked into kafka-rest proxy will it help me in this case (Can I collect metrics with it).
Any help is appreciated.
Promethus JMX Exporter and Jolokia both require connecting to the local JMX port, then exposing a REST API
If you can't connect to that port (for example, you don't have access to the broker servers), then no, there's no alternative.
The REST Proxy is for Kafka client functions, not for broker metrics (it has its own JMX metrics)