<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Promql on Veerendra&#39;s Blog</title>
    <link>https://veerendra2.github.io/tags/promql/</link>
    <description>Recent content in Promql on Veerendra&#39;s Blog</description>
    <generator>Hugo -- 0.161.1</generator>
    <language>en</language>
    <lastBuildDate>Mon, 08 Jun 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://veerendra2.github.io/tags/promql/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>PromQL rate() vs increase()</title>
      <link>https://veerendra2.github.io/promql-rate-v-increase/</link>
      <pubDate>Mon, 08 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://veerendra2.github.io/promql-rate-v-increase/</guid>
      <description>&lt;p&gt;I keep mixing up &lt;code&gt;rate()&lt;/code&gt; and &lt;code&gt;increase()&lt;/code&gt; in PromQL, so this is a short note for future reference.&lt;/p&gt;
&lt;p&gt;Both functions are normally used with &lt;strong&gt;counters&lt;/strong&gt;: metrics that only go up, except when the process restarts and the counter resets.&lt;/p&gt;
&lt;p&gt;The quick difference:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;rate()&lt;/code&gt; answers: &lt;strong&gt;how fast is it increasing?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;increase()&lt;/code&gt; answers: &lt;strong&gt;how much did it increase?&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;rate&#34;&gt;&lt;code&gt;rate()&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;rate()&lt;/code&gt; gives the &lt;strong&gt;average per-second increase&lt;/strong&gt; over a time range.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-promql&#34; data-lang=&#34;promql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;rate&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;http_requests_total&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;5m&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If the counter moved from around &lt;code&gt;280&lt;/code&gt; to &lt;code&gt;700&lt;/code&gt;, the increase is &lt;code&gt;420&lt;/code&gt;. In this example the sampled time difference is &lt;code&gt;270&lt;/code&gt; seconds, so:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
