Skip to content

Commit e593345

Browse files
authored
Merge pull request linkedin#783 from javishere/ADD-partition-status-metric
Add partition status metric
2 parents b9dff73 + c8798e3 commit e593345

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/internal/httpserver/prometheus.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,19 @@ var (
2424
consumerStatusGauge = promauto.NewGaugeVec(
2525
prometheus.GaugeOpts{
2626
Name: "burrow_kafka_consumer_status",
27-
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",
27+
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",
2828
},
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)