How to check if instance is up and running in grafana

I am trying to filter out inactive prometheus exporters in variables with label_values. But I am unable to do so. How can get only instances which are up and running so that one can see metrics for only running instances.