You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using micrometer-registry-prometheus version 1.13.0 with Spring Boot 3.3.0, and sometimes I encounter the following exception when Prometheus scrapes metrics:
java.lang.IllegalArgumentException: -2.0: counters cannot have a negative value
at io.prometheus.metrics.model.snapshots.CounterSnapshot$CounterDataPointSnapshot.validate(CounterSnapshot.java:74)
at io.prometheus.metrics.model.snapshots.CounterSnapshot$CounterDataPointSnapshot.(CounterSnapshot.java:58)
at io.prometheus.metrics.model.snapshots.CounterSnapshot$CounterDataPointSnapshot.(CounterSnapshot.java:46)
at io.micrometer.prometheusmetrics.PrometheusMeterRegistry.lambda$newFunctionCounter$20(PrometheusMeterRegistry.java:372)
at io.micrometer.prometheusmetrics.MicrometerCollector.collect(MicrometerCollector.java:77)
at io.prometheus.metrics.model.registry.PrometheusRegistry.scrape(PrometheusRegistry.java:72)
at io.prometheus.metrics.model.registry.PrometheusRegistry.scrape(PrometheusRegistry.java:57)
at org.springframework.boot.actuate.metrics.export.prometheus.PrometheusScrapeEndpoint.scrape(PrometheusScrapeEndpoint.java:59)
The error message indicates that a counter has a negative value, but it does not specify which counter is causing the problem. This makes it difficult to identify the source of the issue in large applications with multiple counters.
Suggestion:
It would be helpful if the exception message included the name of the counter that is causing the problem. This additional information would significantly improve the ability to troubleshoot issues, especially in complex applications.
The text was updated successfully, but these errors were encountered:
Description:
I am using
micrometer-registry-prometheus
version1.13.0
with Spring Boot3.3.0
, and sometimes I encounter the following exception when Prometheus scrapes metrics:The error message indicates that a counter has a negative value, but it does not specify which counter is causing the problem. This makes it difficult to identify the source of the issue in large applications with multiple counters.
Suggestion:
It would be helpful if the exception message included the name of the counter that is causing the problem. This additional information would significantly improve the ability to troubleshoot issues, especially in complex applications.
The text was updated successfully, but these errors were encountered: