title: http_request_duration_seconds_sum / http_request_duration_seconds_count shows 2 graphs
body: <p>I have a Grafana dashboard, where I try to plot some of the prometheus metrics.</p>
  
  <p>I am trying to calculate the average response time for 2 endpoints using the formula:</p>
  
  <pre><code>http_request_duration_seconds_sum / http_request_duration_seconds_count
  </code></pre>
  
  <p>but when plotting the query into the Grafana graph panel, I get 4 graphs (2 for each) instead of only 2, which I don't understand.</p>
  
  <p><a href="https://i.stack.imgur.com/tyKu9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tyKu9.png" alt="snippet from Grafana"></a></p>
  
  <p>Can anyone tell me, why there are 4 curves instead of 2?
  The two on the top are from the same query and likewise for the two in the buttom.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Is adding </p>
  
  <pre><code>sum(rate(http_request_duration_sum))[24h] / sum(rate(http_request_duration_count))[24h] 
  </code></pre>
  
  <p>the answer? That gives me 2 curves instead of 4, but not sure if the result is what I am looking for (being the average response time for the endpoint).</p>