Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Status

Current state:  [Under Discussion]Accepted

Discussion threadhere

JIRAhttps://issues.apache.org/jira/browse/KAFKA-12882

...

A broker may be alive but unable to establish new connections, emit metrics, or emit logs due to failed DNS resolution. It would be helpful to have a metric that counts the number of brokers registered to a cluster since it is not altogether obvious that a particular broker is not emitting metrics or logs. It would also be helpful to count the number of unfenced brokers so that it is known how many brokers are present in the metadata response and how many are not.

Public Interfaces

kafka.controller:type=KafkaZkControllerWe propose adding two new controller metrics. Note that these metrics are 0 on all nodes except the active controller.

Attribute Name
DescriptionRegisteredBrokerCountThe number of brokers registered in a ZK-based cluster.Attribute NameDescriptionRegisteredBrokerCount
Value when using ZKValue When using KRaft
kafka.controller:type=KafkaController

...

:ActiveBrokerCountThe number of brokers known to the KafkaController
The number of
brokers registered in quorum based cluster.Attribute NameDescriptionUnfencedBrokerCount
registered and unfenced brokers
kafka.controller:type=KafkaController

...

:FencedBrokerCountAlways 0
The number of registered
unfenced brokers in a quorum based cluster.
but fenced brokers


Compatibility, Deprecation, and Migration Plan

N/A

Rejected Alternatives

No migration plan is needed because these metrics are new.

Rejected Alternatives

We discussed the possibility of having a metric which would count all brokers, fenced and unfenced. However, in the ZK world, unlike in the KRaft world, this would be equivalent to counting all active brokers. This might lead people to start using the metric that way, which could complicate their transition from ZK to KRaft. Therefore, it's better to have a metric for active brokers specifically, rather than a metric for all registered brokers.N/A