Current state: adopted
Discussion thread: here
JIRA:
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
The purpose of adding a CurrentControllerId metric is to have an easy way to identify the current controller by looking at the metrics of any Kafka node (broker or controller).
Name | Context | Type | Mode | Description |
---|---|---|---|---|
kafka.server:type=MetadataLoader,name=CurrentControllerId | Broker and Controller | Integer | KRaft and ZK | Outputs the ID of the current controller, or -1 if none is known. |
The CurrentControllerId
metric shows the ID of the controller, as seen by the node in question. If the current node doesn't think there is an active controller, the value of thisd metric will be -1.
Since this is a new metric, there are no compatibility issues.
The new metric will need unit and integration tests as per usual.
One rejected alternative is using the existing ActiveControllerCount
metric. However, when in KRaft mode, ActiveControllerCount
is only exposed on controller nodes, not on broker nodes. That makes it impossible to monitor what the brokers think the current active controller is.