title: increase() in Prometheus sometimes doubles values: how to avoid?
body: <p>I've found that for some graphs I get doubles values from Prometheus where should be just ones:</p>
  <p><a href="https://i.stack.imgur.com/XPwln.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XPwln.png" alt="Graph with twos above bars" /></a></p>
  <p>Query I use:</p>
  <pre><code>increase(signups_count[4m])
  </code></pre>
  <p>Scrape interval is set to the <a href="https://stackoverflow.com/questions/40230057/what-is-the-maximum-scrape-interval-in-prometheus">recommended maximum</a> of 2 minutes.</p>
  <p>If I query the actual data stored:</p>
  <pre><code>curl -gs 'localhost:9090/api/v1/query?query=(signups_count[1h])'
  
  &quot;values&quot;:[
       [1515721365.194, &quot;579&quot;],
       [1515721485.194, &quot;579&quot;],
       [1515721605.194, &quot;580&quot;],
       [1515721725.194, &quot;580&quot;],
       [1515721845.194, &quot;580&quot;],
       [1515721965.194, &quot;580&quot;],
       [1515722085.194, &quot;580&quot;],
       [1515722205.194, &quot;581&quot;],
       [1515722325.194, &quot;581&quot;],
       [1515722445.194, &quot;581&quot;],
       [1515722565.194, &quot;581&quot;]
  ],
  </code></pre>
  <p>I see that there were just two increases. And indeed if I query for these times I see an expected result:</p>
  <pre><code>curl -gs 'localhost:9090/api/v1/query_range?step=4m&amp;query=increase(signups_count[4m])&amp;start=1515721965.194&amp;end=1515722565.194'
  
  &quot;values&quot;: [
       [1515721965.194, &quot;0&quot;],
       [1515722205.194, &quot;1&quot;],
       [1515722445.194, &quot;0&quot;]
  ],
  </code></pre>
  <p>But Grafana (and Prometheus in the GUI) tends to set a different <code>step</code> in queries, with which I get a very unexpected result for a person unfamiliar with internal workings of Prometheus.</p>
  <pre><code>curl -gs 'localhost:9090/api/v1/query_range?step=15&amp;query=increase(signups_count[4m])&amp;start=1515721965.194&amp;end=1515722565.194'
  
  ... skip ...
   [1515722190.194, &quot;0&quot;],
   [1515722205.194, &quot;1&quot;],
   [1515722220.194, &quot;2&quot;],
   [1515722235.194, &quot;2&quot;],
  ... skip ...
  </code></pre>
  <p>Knowing that <code>increase()</code> is just <a href="https://stackoverflow.com/questions/38659784/graphing-slow-counters-with-prometheus-and-grafana">a syntactic sugar for a specific use-case of the <code>rate()</code> function</a>, I guess this is how it is supposed to work given the circumstances.</p>
  <p>How to avoid such situations? How do I make Prometheus/Grafana show me ones for ones, and twos for twos, most of the time? Other than by increasing the scrape interval (this will be my last resort).</p>
  <p>I understand that Prometheus <a href="https://www.youtube.com/watch?v=67Ulrq6DxwA&amp;t=15m02s" rel="noreferrer">isn't an <em>exact</em> sort of tool</a>, so it is fine with me if I would have a good number not at all times, but most of the time.</p>
  <p>What else am I missing here?</p>