Kafka exposes monitoring statistics using Yammer metrics. Yammer metrics is a protocol that exposes six types of metrics: gauges, counters, meters, histograms, timers, and health checks. This recipe shows how to monitor the metrics exposed by Kafka from the server side. In the following recipes, we cover the producer and consumer related metrics.
For this recipe, we just need a Kafka broker up and running.
To set the JMX port, from the Kafka installation directory start the broker using the following command:
$ JMX_PORT=10101 bin/kafka-server-start.sh config/server.properties
Also, JConsole must be installed, check the installation with the following command:
$ jconsole