Monitoring producer statistics
As well as server metrics, there are also producer metrics.
Getting ready
For this recipe, we just need a Kafka broker up and running and JConsole installed.
How to do it...
- Start the console producer for
test_topic
with the JMX parameters enabled with the following command:
$ JMX_PORT=10102 bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test_topic
- Run JConsole using the following command:
$ jconsole 127.0.0.1:10102
- In the following screenshot, see the
MBeans
tab with the Kafka producer metrics:
Figure 9.3: MBeans tab showing the Kafka producer metrics
How it works...
Switch to the MBeans
tab in JConsole; there are several producer metrics. Some of them are as follows:
kafka.producer:type=ProducerRequestMetrics,name=ProducerRequestRateAndTimeMs,clientId=console-producer
: This gives values for the rate of producer requests taking place as the latencies involved. It gives latencies as a percentile: 50, 75, 95, 98, 99, and 99.9. It also gives the time...