title: how to aggregate prometheus counters during a specific time period
body: <p>This is what my metrics endpoint looks like:</p>
  <blockquote>
  <p>app_ui_card_open{host=&quot;foo.bar.com&quot;,card_id=&quot;listing_tickets&quot;,username=&quot;smiller&quot;} 2
  app_ui_card_open{host=&quot;foo.bar.com&quot;,card_id=&quot;listing_companies&quot;,username=&quot;smiller&quot;} 1
  app_ui_card_open{host=&quot;foo.bar.com&quot;,card_id=&quot;listing_contacts&quot;,username=&quot;smiller&quot;} 1</p>
  </blockquote>
  <p>There are other similar lines with other usernames but these are all of them for the &quot;smiller&quot; <code>username</code>.</p>
  <p>I've just started collecting this data over the past week. I'm trying to understand how i can a single count of all of the <code>app_ui_card_open</code> counts per username.</p>
  <p>This is the query i came up with:</p>
  <pre><code>sum(increase(app_ui_card_open{instance=&quot;foo.bar.com&quot;}[1y])) by (username)
  </code></pre>
  <p>However, the produces a value of only <code>1</code> for the &quot;smiller&quot; username. I would expect to see the value of <code>4</code>; the sum of all those metrics listed above since <code>1y</code> would contain the entire dataset.</p>
  <p>Is my query wrong? Is prometheus just doing it's estimating even though the data set is really small?</p>