If I am not wrong this will give me the number of configured jobs. But 
there can be more than one target server in a single job, hence, in that 
case it won't give the total number of target servers.

On Wednesday, March 4, 2020 at 12:42:35 AM UTC+5:30, Julien Pivotto wrote:
>
> On 03 Mar 11:10, Yagyansh S. Kumar wrote: 
> > I want to get the number of target server that I have been scraping the 
> > metrics for. Can this number be dynamic? I mean if I add more servers, 
> the 
> > number should increase automatically. 
> > Thanks in advance! 
>
>
> You can get that with the PromQL query: 
>
>     count(up) by (job) 
>
> regards, 
>
>
>
> -- 
>  (o-    Julien Pivotto 
>  //\    Open-Source Consultant 
>  V_/_   Inuits - https://www.inuits.eu 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/9fb896c6-5629-4352-8cb0-1587a1e5e842%40googlegroups.com.

Reply via email to