Skip to content

Commit 9e45068

Browse files
Hortal, JavierHortal, Javier
authored andcommitted
ADD burrow_kafka_topic_partition_status metric
1 parent 7696cac commit 9e45068

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/internal/httpserver/prometheus.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ var (
2929
[]string{"cluster", "consumer_group"},
3030
)
3131

32+
partitionStatusGauge = promauto.NewGaugeVec(
33+
prometheus.GaugeOpts{
34+
Name: "burrow_kafka_topic_partition_status",
35+
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",
36+
},
37+
[]string{"cluster", "consumer_group", "topic", "partition"},
38+
)
39+
3240
consumerPartitionCurrentOffset = promauto.NewGaugeVec(
3341
prometheus.GaugeOpts{
3442
Name: "burrow_kafka_consumer_current_offset",
@@ -117,6 +125,7 @@ func (hc *Coordinator) handlePrometheusMetrics() http.HandlerFunc {
117125

118126
if partition.Complete == 1.0 {
119127
consumerPartitionCurrentOffset.With(labels).Set(float64(partition.End.Offset))
128+
partitionStatusGauge.With(labels).Set(float64(partition.Status))
120129
}
121130
}
122131
}

0 commit comments

Comments
 (0)