From a0de1383c7f1c54aa73a7983e4bdd68edd72aa3a Mon Sep 17 00:00:00 2001 From: Luke Chen Date: Wed, 15 May 2024 15:27:18 +0800 Subject: [PATCH] issue#409: skip error group members --- kafka_exporter.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kafka_exporter.go b/kafka_exporter.go index 36021149..95a70a2d 100644 --- a/kafka_exporter.go +++ b/kafka_exporter.go @@ -569,6 +569,10 @@ func (e *Exporter) collect(ch chan<- prometheus.Metric) { return } for _, group := range describeGroups.Groups { + if group.Err != 0 { + klog.Errorf("Cannot describe for the group %s with error code %d", group.GroupId, group.Err) + continue + } offsetFetchRequest := sarama.OffsetFetchRequest{ConsumerGroup: group.GroupId, Version: 1} if e.offsetShowAll { for topic, partitions := range offset {