From 9e45068a43a1cc72984c39a5601fe3d2abb3561b Mon Sep 17 00:00:00 2001 From: "Hortal, Javier" Date: Mon, 12 Jun 2023 17:57:11 +0200 Subject: [PATCH 1/2] ADD burrow_kafka_topic_partition_status metric --- core/internal/httpserver/prometheus.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/internal/httpserver/prometheus.go b/core/internal/httpserver/prometheus.go index 7e0e7399..beca1bd3 100644 --- a/core/internal/httpserver/prometheus.go +++ b/core/internal/httpserver/prometheus.go @@ -29,6 +29,14 @@ var ( []string{"cluster", "consumer_group"}, ) + partitionStatusGauge = promauto.NewGaugeVec( + prometheus.GaugeOpts{ + Name: "burrow_kafka_topic_partition_status", + Help: "The status of topic partition. It is calculated from the highest status for the individual partitions. Statuses are an index list from OK, WARN, STOP, STALL, REWIND", + }, + []string{"cluster", "consumer_group", "topic", "partition"}, + ) + consumerPartitionCurrentOffset = promauto.NewGaugeVec( prometheus.GaugeOpts{ Name: "burrow_kafka_consumer_current_offset", @@ -117,6 +125,7 @@ func (hc *Coordinator) handlePrometheusMetrics() http.HandlerFunc { if partition.Complete == 1.0 { consumerPartitionCurrentOffset.With(labels).Set(float64(partition.End.Offset)) + partitionStatusGauge.With(labels).Set(float64(partition.Status)) } } } From c8798e3c312f191c42f38af647b62ba8adf3f477 Mon Sep 17 00:00:00 2001 From: "Hortal, Javier" Date: Mon, 12 Jun 2023 17:57:45 +0200 Subject: [PATCH 2/2] FIX burrow_kafka_consumer_status Status comment --- core/internal/httpserver/prometheus.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/internal/httpserver/prometheus.go b/core/internal/httpserver/prometheus.go index beca1bd3..97e71146 100644 --- a/core/internal/httpserver/prometheus.go +++ b/core/internal/httpserver/prometheus.go @@ -24,7 +24,7 @@ var ( consumerStatusGauge = promauto.NewGaugeVec( prometheus.GaugeOpts{ Name: "burrow_kafka_consumer_status", - Help: "The status of the consumer group. It is calculated from the highest status for the individual partitions. Statuses are an index list from NOTFOUND, OK, WARN, ERR, STOP, STALL, REWIND", + Help: "The status of the consumer group. It is calculated from the highest status for the individual partitions. Statuses are an index list from NOTFOUND, OK, WARN, or ERR", }, []string{"cluster", "consumer_group"}, )