Grafana equation


I`m using blackbox exporter and Prometheus to query multiple dns records.
Now i want to make a graph in Grafana with the with the percentage of failures

my graph has to values 1 and 0 , when is 1 is up and when is 0 is down. Based on a equation i want to calculate the percentage of uptime.

I try different equation but unfortunately i field :slight_smile:

Thanks in advance!