Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalArgumentException: Counts in ClassicHistogramBuckets cannot be negative. #5482

Open
sahilkamboj334 opened this issue Sep 19, 2024 · 1 comment
Labels
waiting for feedback We need additional information before we can continue

Comments

@sahilkamboj334
Copy link

sahilkamboj334 commented Sep 19, 2024

Describe the bug
Getting java.lang.IllegalArgumentException: Counts in ClassicHistogramBuckets cannot be negative.

Environment
Springboot - 3.3.0

  • Micrometer core version 1.13.0
  • Micrometer registry 1.13.0
  • Linux
  • Java version: 21

To Reproduce
How to reproduce the bug:
Just enable slo for http server requests. Below is the config i am using
management.metrics.distribution.slo.http.server.requests=10ms,25ms,50ms,80ms,110ms,200ms,300ms,450ms,1100ms,6100ms

Expected behavior
Should not result in any exception.

Additional context
I have checked #4988. But it is not use case of long task timers.

Trace:-

{"instant":{"epochSecond":1725331335,"nanoOfSecond":36394143},"thread":"http-nio-8778-exec-59","level":"ERROR","loggerName":"org.apache.catalina.core.ContainerBase.[Tomcat-1].[localhost].[/].[dispatcherServletRegistration]","message":"Servlet.service() for servlet [dispatcherServletRegistration] in context with path [] threw exception [Request processing failed: java.lang.IllegalArgumentException: Counts in ClassicHistogramBuckets cannot be negative.] with root cause","thrown":{"commonElementCount":0,"localizedMessage":"Counts in ClassicHistogramBuckets cannot be negative.","message":"Counts in ClassicHistogramBuckets cannot be negative.","name":"java.lang.IllegalArgumentException","extendedStackTrace":[{"class":"io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets","method":"validate","file":"ClassicHistogramBuckets.java","line":147,"exact":false,"location":"prometheus-metrics-model-1.2.1.jar!/","version":"?"},{"class":"io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets","method":"sortAndValidate","file":"ClassicHistogramBuckets.java","line":108,"exact":false,"location":"prometheus-metrics-model-1.2.1.jar!/","version":"?"},{"class":"io.prometheus.metrics.model.snapshots.ClassicHistogramBuckets","method":"of","file":"ClassicHistogramBuckets.java","line":53,"exact":false,"location":"prometheus-metrics-model-1.2.1.jar!/","version":"?"},{"class":"io.micrometer.prometheusmetrics.PrometheusMeterRegistry","method":"lambda$addDistributionStatisticSamples$29","file":"PrometheusMeterRegistry.java","line":504,"exact":false,"location":"micrometer-registry-prometheus-1.13.0.jar!/","version":"1.13.0"},{"class":"io.micrometer.prometheusmetrics.MicrometerCollector","method":"collect","file":"MicrometerCollector.java","line":77,"exact":false,"location":"micrometer-registry-prometheus-1.13.0.jar!/","version":"1.13.0"},{"class":"io.prometheus.metrics.model.registry.PrometheusRegistry","method":"scrape","file":"PrometheusRegistry.java","line":72,"exact":false,"location":"prometheus-metrics-model-1.2.1.jar!/","version":"?"},{"class":"io.prometheus.metrics.model.registry.PrometheusRegistry","method":"scrape","file":"PrometheusRegistry.java","line":57,"exact":false,"location":"prometheus-metrics-model-1.2.1.jar!/","version":"?"},{"class":"org.springframework.boot.actuate.metrics.export.prometheus.PrometheusScrapeEndpoint","method":"scrape","file":"PrometheusScrapeEndpoint.java","line":59,"exact":false,"location":"spring-boot-actuator-3.3.0.jar!/","version":"3.3.0"},{"module":"java.base","moduleVersion":"21.0.2","class":"jdk.internal.reflect.DirectMethodHandleAccessor","method":"invoke","file":"DirectMethodHandleAccessor.java","line":103,"exact":false,"location":"?","version":"?"},{"module":"java.base","moduleVersion":"21.0.2","class":"java.lang.reflect.Method","method":"invoke","file":"Method.java","line":580,"exact":false,"location":"?","version":"?"},{"class":"org.springframework.util.ReflectionUtils","method":"invokeMethod","file":"ReflectionUtils.java","line":281,"exact":false,"location":"spring-core-6.1.8.jar!/","version":"6.1.8"},{"class":"org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker","method":"invoke","file":"ReflectiveOperationInvoker.java","line":74,"exact":false,"location":"spring-boot-actuator-3.3.0.jar!/","version":"3.3.0"},{"class":"org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation","method":"invoke","file":"AbstractDiscoveredOperation.java","line":60,"exact":false,"location":"spring-boot-actuator-3.3.0.jar!/","version":"3.3.0"},{"class":"org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$ServletWebOperationAdapter","method":"handle","file":"AbstractWebMvcEndpointHandlerMapping.java","line":327,"exact":false,"location":"spring-boot-actuator-3.3.0.jar!/","version":"3.3.0"},{"class":"org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler","method":"handle","file":"AbstractWebMvcEndpointHandlerMapping.java","line":434,"exact":false,"location":"spring-boot-actuator-3.3.0.jar!/","version":"3.3.0"},{"module":"java.base","moduleVersion":"21.0.2","class":"jdk.internal.reflect.DirectMethodHandleAccessor","method":"invoke","file":"DirectMethodHandleAccessor.java","line":103,"exact":false,"location":"?","version":"?"},{"module":"java.base","moduleVersion":"21.0.2","class":"java.lang.reflect.Method","method":"invoke","file":"Method.java","line":580,"exact":false,"location":"?","version":"?"},{"class":"org.springframework.web.method.support.InvocableHandlerMethod","method":"doInvoke","file":"InvocableHandlerMethod.java","line":255,"exact":false,"location":"spring-web-6.1.8.jar!/","version":"6.1.8"},{"class":"org.springframework.web.method.support.InvocableHandlerMethod","method":"invokeForRequest","file":"InvocableHandlerMethod.java","line":188,"exact":false,"location":"spring-web-6.1.8.jar!/","version":"6.1.8"},{"class":"org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod","method":"invokeAndHandle","file":"ServletInvocableHandlerMethod.java","line":118,"exact":false,"location":"spring-webmvc-6.1.8.jar!/","version":"6.1.8"},{"class":"org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter","method":"invokeHandlerMethod","file":"RequestMappingHandlerAdapter.java","line":926,"exact":false,"location":"spring-webmvc-6.1.8.jar!/","version":"6.1.8"},{"class":"org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter","method":"handleInternal","file":"RequestMappingHandlerAdapter.java","line":831,"exact":false,"location":"spring-webmvc-6.1.8.jar!/","version":"6.1.8"},{"class":"org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter","method":"handle","file":"AbstractHandlerMethodAdapter.java","line":87,"exact":false,"location":"spring-webmvc-6.1.8.jar!/","version":"6.1.8"},{"class":"org.springframework.boot.actuate.autoconfigure.web.servlet.CompositeHandlerAdapter","method":"handle","file":"CompositeHandlerAdapter.java","line":58,"exact":false,"location":"spring-boot-actuator-autoconfigure-3.3.0.jar!/","version":"3.3.0"},{"class":"org.springframework.web.servlet.DispatcherServlet","method":"doDispatch","file":"DispatcherServlet.java","line":1089,"exact":false,"location":"spring-webmvc-6.1.8.jar!/","version":"6.1.8"},{"class":"org.springframework.web.servlet.DispatcherServlet","method":"doService","file":"DispatcherServlet.java","line":979,"exact":false,"location":"spring-webmvc-6.1.8.jar!/","version":"6.1.8"},{"class":"org.springframework.web.servlet.FrameworkServlet","method":"processRequest","file":"FrameworkServlet.java","line":1014,"exact":false,"location":"spring-webmvc-6.1.8.jar!/","version":"6.1.8"},{"class":"org.springframework.web.servlet.FrameworkServlet","method":"doGet","file":"FrameworkServlet.java","line":903,"exact":false,"location":"spring-webmvc-6.1.8.jar!/","version":"6.1.8"},{"class":"jakarta.servlet.http.HttpServlet","method":"service","file":"HttpServlet.java","line":564,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"6.0.0"},{"class":"org.springframework.web.servlet.FrameworkServlet","method":"service","file":"FrameworkServlet.java","line":885,"exact":false,"location":"spring-webmvc-6.1.8.jar!/","version":"6.1.8"},{"class":"jakarta.servlet.http.HttpServlet","method":"service","file":"HttpServlet.java","line":658,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"6.0.0"},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"internalDoFilter","file":"ApplicationFilterChain.java","line":195,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.catalina.core.ApplicationFilterChain","method":"doFilter","file":"ApplicationFilterChain.java","line":140,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.catalina.core.StandardWrapperValve","method":"invoke","file":"StandardWrapperValve.java","line":167,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.catalina.core.StandardContextValve","method":"invoke","file":"StandardContextValve.java","line":90,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.catalina.authenticator.AuthenticatorBase","method":"invoke","file":"AuthenticatorBase.java","line":482,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.catalina.core.StandardHostValve","method":"invoke","file":"StandardHostValve.java","line":115,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.catalina.valves.ErrorReportValve","method":"invoke","file":"ErrorReportValve.java","line":93,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.catalina.core.StandardEngineValve","method":"invoke","file":"StandardEngineValve.java","line":74,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.catalina.valves.AbstractAccessLogValve","method":"invoke","file":"AbstractAccessLogValve.java","line":663,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.catalina.connector.CoyoteAdapter","method":"service","file":"CoyoteAdapter.java","line":344,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.coyote.http11.Http11Processor","method":"service","file":"Http11Processor.java","line":389,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.coyote.AbstractProcessorLight","method":"process","file":"AbstractProcessorLight.java","line":63,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.coyote.AbstractProtocol$ConnectionHandler","method":"process","file":"AbstractProtocol.java","line":896,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.tomcat.util.net.NioEndpoint$SocketProcessor","method":"doRun","file":"NioEndpoint.java","line":1741,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.tomcat.util.net.SocketProcessorBase","method":"run","file":"SocketProcessorBase.java","line":52,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.tomcat.util.threads.ThreadPoolExecutor","method":"runWorker","file":"ThreadPoolExecutor.java","line":1190,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker","method":"run","file":"ThreadPoolExecutor.java","line":659,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"class":"org.apache.tomcat.util.threads.TaskThread$WrappingRunnable","method":"run","file":"TaskThread.java","line":63,"exact":false,"location":"tomcat-embed-core-10.1.24.jar!/","version":"?"},{"module":"java.base","moduleVersion":"21.0.2","class":"java.lang.Thread","method":"run","file":"Thread.java","line":1583,"exact":true,"location":"?","version":"?"}]},"endOfBatch":false,"loggerFqcn":"java.util.logging.Logger","threadId":352,"threadPriority":5}

@jonatan-ivanov / @shakuzen please help.

@shakuzen
Copy link
Member

I believe this may be #5193 which was fixed in 1.13.2. Could you please try with the latest 1.13 version (at the time that's 1.13.4) and let us know if you still see the issue?

@shakuzen shakuzen added waiting for feedback We need additional information before we can continue and removed waiting-for-triage labels Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback We need additional information before we can continue
Projects
None yet
Development

No branches or pull requests

2 participants