diff --git a/kafka_exporter.go b/kafka_exporter.go index 71d1b27a..6a83b89e 100644 --- a/kafka_exporter.go +++ b/kafka_exporter.go @@ -583,6 +583,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)