-
Notifications
You must be signed in to change notification settings - Fork 774
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
Duplicate metrics #271
Comments
This usually means you registered the same metric twice somewhere, with newer versions of the client you'll get an error at registration time if that happens. What client version are you on, and where are these metrics coming from? |
I am using 0.0.23. I just have one single Upon startup the metrics mentioned do not exist. They are created once specific endpoints are accessed. So there might be a problem in that code. But the endpoints are created by Spring Boot Actuator. Therefore the problem has to be either in Spring Boot or the Prometheus client IMHO - unless I did something stupid. |
Ah, this is likely a bug in whatever is producing those Spring metrics as a few modules are known to have duplicates (including servo). I'd suggest filing a bug with servo. See #130 |
Ah, thanks - that sounds a lot like my problem. I didn't look hard enough :-) |
I just published an update to the project https://github.com/ewolff/microservice-consul . It basically a simple sample application to show microservices and Consul. Now I added Prometheus. However, some metrics were duplicated so I did a hack https://github.com/ewolff/microservice-consul/blob/master/microservice-consul-demo/microservice-consul-demo-order/src/main/java/com/ewolff/microservice/order/prometheus/MetricsServletFix.java . This resolves the issue.
gauge_servo_response_health
andgauge_servo_response_prometheus
were examples. Upon startup there were no duplicates. So it happened after the/health
or/prometheus
Endpoint were accessed.I tried to implement a minimal version to make it easier to reproduce but that seems to be hard. I.e. https://github.com/thomasdarimont/spring-boot-prometheus-example doesn't have that problem. So maybe I did something stupid but I am not sure what.
The text was updated successfully, but these errors were encountered: