From f3f2efe0067068ae73d28f557490b142a12c6495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=B6=85=E7=BE=A4?= Date: Thu, 8 Sep 2022 10:33:49 +0800 Subject: [PATCH] fix: when consumergrou not hava acitve consumer filter metrics --- kafka_exporter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kafka_exporter.go b/kafka_exporter.go index 3fabfdd8..45be58ec 100644 --- a/kafka_exporter.go +++ b/kafka_exporter.go @@ -565,6 +565,9 @@ func (e *Exporter) collect(ch chan<- prometheus.Metric) { return } for _, group := range describeGroups.Groups { + if group.State != "Stable" { + continue + } offsetFetchRequest := sarama.OffsetFetchRequest{ConsumerGroup: group.GroupId, Version: 1} if e.offsetShowAll { for topic, partitions := range offset {