O'Reilly logo

Apache Kafka Cookbook by Saurabh Minni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Monitoring server stats

Kafka exposes various stats for monitoring using Yammer Metrics. We will explore this topic: how to monitor the various metrics exposed by Kafka from the server side. We will cover producer- and consumer-related metrics in the following topics.

Getting ready

You need to have the Kafka server up-and-running with the JMX port. To set the JMX port, you need to run Kafka using the following command.

> JMX_PORT=10101 ./bin/kafka-server-start.sh config/server.properties

Next you need to have jconsole installed to monitor Kafka.

How to do it…

  1. From your command prompt, you need to run jconsole using the following command.
    > jconsole 127.0.0.1:10101
    
  2. Now you can see all the different parameters plotted over time.

    JConsole showing details ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required