title: Calculating availability in Prometheus based on response value
body: <p>I am trying to calculate the availability of elasticsearch using prometheus. One of the jobs that runs get the cluster status as a value, being either 0, 1 or 2 where anything above 1 is considered unavailable.
  Using the answer from <a href="https://stackoverflow.com/questions/49156704/im-trying-to-calculate-uptime-in-grafana-based-on-the-successful-responses-from">here</a> does not work due to all the jobs succeeding and so the query has to do something along the lines of:</p>
  
  <pre><code>avg_over_time(es_cluster_status{cluster="name", instance="my_es"}&gt;1[24h])
  </code></pre>
  
  <p>This does however not work due to the <code>&gt;1</code>.</p>