Can it validate if my application has exposed metrics?

Hey all,

I was talking to a teammate if we could use a tool like SonarQube to analyze if our application has metrics being exposed (Prometheus metrics, to be clear, /metrics). Since it’s a simple path, I believe it can be done, but the problem is not just if the path exists, but if it has metrics or not.


Hey there.

What kind of metrics are you looking for?

Hey Colin,

My service has a /metrics path that exposes metrics for Prometheus. Example from a /metrics path content below:

http_requests_total {example=“example”} 114

All good. The problem is, those metrics could not be working, ie:

http_requests_total {example=“example”} 0

The question is, can we validate it with SonarQube is there’s values being exposed from the /metrics path? Anything greater than 0 should be fine.