You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »


Status

Current state: Under Discussion

Vote thread: NA

Discussion thread: https://lists.apache.org/thread/8ky7t8xybgy2omkqld1fbtk16op9p5qo

JIRA: KAFKA-19467 

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

The controller thread is responsible for critical cluster coordination tasks, including leadership elections, topic metadata updates, partition assignments, and Raft-based state changes. However, there is currently no metric to measure how much time the controller spends actively processing work versus waiting for new events or Raft callbacks. This lack of visibility makes it challenging to assess the controller’s performance, detect potential bottlenecks, or optimize resource allocation in high-load scenarios. This KIP proposes introducing a new metric to monitor the controller thread’s idleness ratio.

Public Interfaces

Monitoring

NameTypeDescription
kafka.controller:type=ControllerEventManager,name=ControllerThreadIdleRatioGaugeThe ratio of time the controller thread is idle relative to the total time (idle+active). Values range from 0 to 1, where 0 indicates the thread is fully busy and 1 indicates it is completely idle.

Compatibility, Deprecation, and Migration Plan

This KIP introduces a single new metric, with no changes to existing behavior, APIs, or protocols. There will be no impact on existing Kafka versions

Test Plan

We will add unit tests to verify the correctness of the metric.

Rejected Alternatives

If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.

  • No labels