Leader Election Rate and Time Ms
The Leader Election Rate & Time Ms metric group contains metrics regarding leader elections. The metrics available are:
- Leader Election
- Unclean Leader Elections
The Leader Election metric shows the mean rate, count, maximum rate, and one minute rate of leader elections. Leader elections occur when the current leader of a partition becomes unavailable. Any available in-sync replicas for the partition are eligible to become the new leader. As the new leader must be an in-sync replica, elections should not cause any problems apart from a small delay in responding to requests to that partition while the new leader is being chosen.
Unclean Leader Elections
The Unclean Leader Elections metric shows the number of failures to elect a suitable leader per second. Unclean leader elections are caused when there are no available in-sync replicas for a partition (either due to network issues, lag causing the broker to fall behind, or brokers going down completely), so an out of sync replica is the only option for the leader. When an out of sync replica is elected leader, all data not replicated from the previous leader is lost forever.