@@ -47,6 +47,7 @@ type jszCollector struct {
4747 streamConsumerCount * prometheus.Desc
4848 streamSubjectCount * prometheus.Desc
4949 streamLimitBytes * prometheus.Desc
50+ streamLimitMessages * prometheus.Desc
5051
5152 // Consumer stats
5253 consumerDeliveredConsumerSeq * prometheus.Desc
@@ -143,6 +144,13 @@ func newJszCollector(system, endpoint string, servers []*CollectedServer) promet
143144 streamLabels ,
144145 nil ,
145146 ),
147+ // jetstream_stream_limit_messages
148+ streamLimitMessages : prometheus .NewDesc (
149+ prometheus .BuildFQName (system , "stream" , "limit_messages" ),
150+ "The maximum number of messages allowed in a JetStream stream as per its configuration. A value of -1 indicates no limit." ,
151+ streamLabels ,
152+ nil ,
153+ ),
146154 // jetstream_stream_total_bytes
147155 streamBytes : prometheus .NewDesc (
148156 prometheus .BuildFQName (system , "stream" , "total_bytes" ),
@@ -272,6 +280,7 @@ func (nc *jszCollector) Describe(ch chan<- *prometheus.Desc) {
272280 ch <- nc .streamConsumerCount
273281 ch <- nc .streamSubjectCount
274282 ch <- nc .streamLimitBytes
283+ ch <- nc .streamLimitMessages
275284
276285 // Consumer state
277286 ch <- nc .consumerDeliveredConsumerSeq
@@ -380,6 +389,7 @@ func (nc *jszCollector) Collect(ch chan<- prometheus.Metric) {
380389
381390 if stream .Config != nil {
382391 ch <- streamMetric (nc .streamLimitBytes , float64 (stream .Config .MaxBytes ))
392+ ch <- streamMetric (nc .streamLimitMessages , float64 (stream .Config .MaxMsgs ))
383393 }
384394
385395 // Now with the consumers.
0 commit comments