Overview
Kafka exposes metrics through JMX. Ones worth watching, with the exact names from the monitoring page: • kafka.server:type=ReplicaManager,name=UnderReplicatedPartitions: partitions with |ISR| < |all replicas|, normally 0 (it rises while a broker is down) • kafka.controller:type=KafkaController,name=ActiveControllerCount: exactly one node should report 1 • kafka.controller:type=KafkaController,name=OfflinePartitionsCount: offline (non-internal) topic partitions as seen by the controller • kafka.server:type=KafkaRequestHandlerPool,name=RequestHandlerAvgIdlePercent: between 0 and 1, ideally above 0.3 • kafka.network:type=SocketServer,name=NetworkProcessorAvgIdlePercent: between 0 and 1, ideally above 0.3 • kafka.server:type=BrokerTopicMetrics,name=BytesInPerSec and BytesOutPerSec: throughput • kafka.log:type=LogManager,name=OfflineLogDirectoryCount: normally 0 • Consumer lag: records-lag-max on the consumer, or kafka-consumer-groups.sh --describe
Key configuration
# JMX_PORT enables remote JMX; KAFKA_JMX_OPTS sets the JMX options.
# Setting KAFKA_JMX_OPTS replaces the defaults in kafka-run-class.sh.
JMX_PORT=9999
# kafka-run-class.sh also appends KAFKA_OPTS to the java command.Production tip
Check yourself
Across the nodes of a cluster, how many should report ActiveControllerCount of 1?
Sources
- Monitoring (4.2 documentation) (opens in a new tab)
- Basic Kafka operations (4.2 documentation) (opens in a new tab)
- kafka-run-class.sh (4.2 source) (opens in a new tab)
Checked against Kafka 4.2 documentation on Oct 2026. Draft: not yet reviewed by a Kafka specialist. Releases move on, so confirm against the current documentation before you act on a number.