title: Query prometheus counter across multiple instances
body: <p>I got several instances exposing a Prometheus counter and would like to aggregate all values over a certain period of time. I've been trying a lot of different things but can't get it working.</p>
  <p>Let's assume my metric name is request_total. This metric has facets for <code>path</code> and <code>status_code</code>. My goal is to get an overall sum of this counter, without filtering it by any of its facets. If I run <code>sum by (instance) (request_total)</code>, I get the following graph from Prometheus:</p>
  <p><a href="https://i.stack.imgur.com/sZ4tC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sZ4tC.png" alt="enter image description here" /></a></p>
  <p>As we can see my counter seems to be correct for each instance. However, if I try to sum all those values with <code>sum (request_total)</code>, I get the following result:</p>
  <p><a href="https://i.stack.imgur.com/YcZEj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YcZEj.png" alt="enter image description here" /></a></p>
  <p>I'm pretty new to Prometheus but was expecting that the counter would actually not be reset and better cumulative. Could you please help me and tell me what I am missing here ?</p>
  <p>Thanks in advance</p>