Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to get all the failed targets that Prometheus knows about?

Hi i'm working on a solution that needs to know how many targets failed to be fetched. I'm currently running a node-exporter job with static configuration, so all the hosts are known from the get go. What i would like to display in Grafana is something like "2/3 hosts are up". But i can't really seem to find a metric that contains the same numbers as shown in the image.

enter image description here

All help is much appreciated, right now i'm searching for keywords in the metrics page of whatever exporter is containing metrics, if there is an easier way of finding the correct data please let me know.

like image 587
markus randa Avatar asked Oct 17 '25 06:10

markus randa


1 Answers

count(up == 0) by (job)

should give you "1" for "node-exporter", while:

count(up) by (job)

should give you "3".

like image 149
bjakubski Avatar answered Oct 21 '25 04:10

bjakubski