title: Prometheus: filter query based on another metric
body: <p>Say I have two metrics in prometheus, both counters:</p>
  <ul>
  <li><code>requests_processed_total</code></li>
  <li><code>requests_failed_total</code></li>
  </ul>
  <p>They both have a matching <code>service</code> label. Example:</p>
  <pre><code>requests_processed_total{service=&quot;news&quot;} 1097
  requests_processed_total{service=&quot;store&quot;} 487
  requests_failed_total{service=&quot;news&quot;} 23
  requests_failed_total{service=&quot;store&quot;} 89
  </code></pre>
  <p>How to query the <code>requests_failed_total</code>, but only for services whose <code>request_processed_total &gt; 1000</code>.</p>
  <p>I'm expecting the following response:</p>
  <pre><code>requests_failed_total{service=&quot;news&quot;} 23
  
  # Note that the &quot;store&quot; service is excluded
  </code></pre>