title: Prometheus increase not handling process restarts
body: <p>I am trying to figure out the behavior of Prometheus' <em>increase()</em> querying function with process restarts. </p>
  
  <p>When there is a process restart within a 2m interval and I query:</p>
  
  <pre><code>sum(increase(my_metric_total[2m])) 
  </code></pre>
  
  <p>I get a value less than expected. </p>
  
  <p>For example, in a simple experiment I mock:</p>
  
  <ul>
  <li>3 <em>lcm_restarts</em></li>
  <li>1 process restart</li>
  <li>2 <em>lcm_restarts</em></li>
  </ul>
  
  <p>All within a 2 minute interval. </p>
  
  <p>Upon querying:</p>
  
  <pre><code>sum(increase(lcm_restarts[2m])) 
  </code></pre>
  
  <p>I receive a value of ~4.5 when I am expecting 5.</p>
  
  <p><a href="https://i.stack.imgur.com/QPm3i.png" rel="noreferrer">lcm_restarts graph</a></p>
  
  <p><a href="https://i.stack.imgur.com/0ERIu.png" rel="noreferrer">sum(increase(lcm_restarts[2m])) result</a></p>
  
  <p>Could someone please explain?</p>