Convert spring boot actuator metrics to prometheus #251
Convert spring boot actuator metrics to prometheus #251hsdmiranda wants to merge 2 commits intoprometheus:masterprometheus/client_java:masterfrom
Conversation
|
Hi, Is possible add HTTP response code (example: 200,400,500) to labels? |
|
It is for counters. Spring actuator expose those as well, but not for gauge. |
|
This seems very fragile and depends on assumptions of metric naming that are not going to be true in general. I don't think this is something we can include out of the box, as it's going to be environment specific. |
|
I did feel the same way once I wrote it, but it is environment specific just for spring boot. Without this converter the metrics becomes quite useless. |
|
It's environment specific to what other metrics you have lying around, and which endpoints you have. The spring boot metrics integration is only meant to be a stop gap until you can get instrumentation with the client library in place. |
@hsdmiranda Spring has initial support to milti-dimensional metrics coming https://github.com/spring-projects/spring-metrics/blob/master/src/main/java/org/springframework/metrics/instrument/web/MetricsWebFilter.java It has a few point releases, so you can pull it in via maven. It is pretty new, but coming together pretty quickly. I agree that the current |
I don't really agree with that. But I strongly agree with the fragile reason. |
The same could be said about the Dropwizard integration. It's better than nothing, and gives you something to work from when starting out. |
|
I agree that is better than nothing. But with the current solution for spring boot is just like nothing :) I think the solution as proposed by @checketts will be a better one, once they release the multi-dimension metrics |
Spring boot actuator already measures some HTTP metrics and expose them, but the spring boot integration with prometheus just convert them in a way that is not really useful. See example bellow:
Spring boot actuator format:
How is current been converted, what is quite useless if you try to create some dashboards
And this is how is supposed to be:
In case this PR is accepted I can also create another converter for COUNTERs.