danielqsj / kafka_exporter

Kafka exporter for Prometheus
Apache License 2.0
2.18k stars 610 forks source link

fix: Fixing Issue with Member Assignments in Consumer Group #429

Closed sciclon2 closed 1 month ago

sciclon2 commented 6 months ago

PR Summary:

Title: Fixing Issue with Member Assignments in Consumer Group

Description: The code was updated to handle cases where consumer group members do not have any assigned partition-topic (for example in a rebalance). Previously, the code was expecting all assignments to have a value, leading to errors when encountering members without assignments. The fix involved checking if member.MemberAssignment is not an empty list before processing the assignment to ensure proper handling of all scenarios within the consumer group.

Example:

Previous Behavior:

Fix Implemented:

By incorporating this fix, the code now effectively manages scenarios where consumer group members may not have any assigned partition-topic, preventing errors and enhancing the overall functionality of the system.

danielqsj commented 1 month ago

LGTM, thanks @sciclon2