Skip to content

Commit

Permalink
Add consumer ack floor metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
phho committed May 6, 2022
1 parent 3a833b6 commit ad9c09c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions collector/jsz.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ type jszCollector struct {
consumerNumRedelivered *prometheus.Desc
consumerNumWaiting *prometheus.Desc
consumerNumPending *prometheus.Desc
consumerAckFloorStreamSeq *prometheus.Desc
consumerAckFloorConsumerSeq *prometheus.Desc
}

func isJszEndpoint(system string) bool {
Expand Down Expand Up @@ -191,6 +193,18 @@ func newJszCollector(system, endpoint string, servers []*CollectedServer) promet
consumerLabels,
nil,
),
consumerAckFloorStreamSeq: prometheus.NewDesc(
prometheus.BuildFQName(system, "consumer", "ack_floor_stream_seq"),
"Number of ack floor stream seq from a consumer",
consumerLabels,
nil,
),
consumerAckFloorConsumerSeq: prometheus.NewDesc(
prometheus.BuildFQName(system, "consumer", "ack_floor_consumer_seq"),
"Number of ack floor consumer seq from a consumer",
consumerLabels,
nil,
),
}

// Use the endpoint
Expand Down Expand Up @@ -345,6 +359,8 @@ func (nc *jszCollector) Collect(ch chan<- prometheus.Metric) {
ch <- consumerMetric(nc.consumerNumRedelivered, float64(consumer.NumRedelivered))
ch <- consumerMetric(nc.consumerNumWaiting, float64(consumer.NumWaiting))
ch <- consumerMetric(nc.consumerNumPending, float64(consumer.NumPending))
ch <- consumerMetric(nc.consumerAckFloorStreamSeq, float64(consumer.AckFloor.Stream))
ch <- consumerMetric(nc.consumerAckFloorConsumerSeq, float64(consumer.AckFloor.Consumer))
}
}
}
Expand Down

0 comments on commit ad9c09c

Please sign in to comment.