up==1 in label_values (Grafana)

26 views
Skip to first unread message

Kishore Chopne

unread,
Feb 12, 2023, 12:55:21 PM2/12/23
to Prometheus Users
Hi, 
     I am trying to get only active instances in my dashboard for this I need to only get active instances in the variable using label_values(grafana) and up==1.
However, I am unable to use up==1 with label_values function in Grafana.  is there an alternate way to only show active instances on the dashboard.  Thanks in advance.

/Kishore 

Ben Kochie

unread,
Feb 12, 2023, 1:13:06 PM2/12/23
to Kishore Chopne, Prometheus Users
You could create a recording rule like this:
- record: active_instances
  expr: up == 1

Otherwise you can use a normal query and parse out the instances.

--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/809b1774-1ad3-4a64-a691-3a9c8a44410fn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages