Skip to content

Commit

Permalink
Merge pull request linkedin#783 from javishere/ADD-partition-status-m…
Browse files Browse the repository at this point in the history
…etric

Add partition status metric
  • Loading branch information
bai authored Jul 3, 2023
2 parents b9dff73 + c8798e3 commit e593345
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/internal/httpserver/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,19 @@ 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"},
)

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",
Expand Down Expand Up @@ -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))
}
}
}
Expand Down

0 comments on commit e593345

Please sign in to comment.