Skip to content

Commit

Permalink
Fixed scenario where consumers may not have assignments in Consumer G…
Browse files Browse the repository at this point in the history
…roups
  • Loading branch information
sciclon2 committed Mar 14, 2024
1 parent b66d284 commit 84b3176
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kafka_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,10 @@ func (e *Exporter) collect(ch chan<- prometheus.Metric) {
}
} else {
for _, member := range group.Members {
if len(member.MemberAssignment) == 0 {
klog.Warningf("MemberAssignment is empty for group member: %v in group: %v", member.MemberId, group.GroupId)
continue
}
assignment, err := member.GetMemberAssignment()
if err != nil {
klog.Errorf("Cannot get GetMemberAssignment of group member %v : %v", member, err)
Expand Down

0 comments on commit 84b3176

Please sign in to comment.