The "increase" function calculates how much some counter has grown and the "rate" function calculates the amount per second the measure grows.

Analyzing your data I think you used [30s] for the "increase" and [1m] for the "rate" (the correct used values are important to the result).

Basically, for example, in time 2m we have:

increase[30s] = count at 2m - count at 1.5m = 4423 - 4402 = 21
rate[1m]      = (count at 2m - count at 1m) / 60 = (4423 - 4381) / 60 = 0.7

Prometheus documentation: increase and rate.

Answer from Marcelo Ávila de Oliveira on Stack Overflow
🌐
MetricFire
metricfire.com › blog › understanding-the-prometheus-rate-function
How the Prometheus rate() function works | MetricFire
March 12, 2026 - They do not return any results if less than two samples are available. PromQL indicates range vectors by writing a time range in square brackets next to a selector that says how much time it should go into the past.
🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › functions
Query functions | Prometheus
Use rate in recording rules so that increases are tracked consistently on a per-second basis. The info function is an experiment to improve UX around including labels from info metrics . The behavior of this function may change in future versions of Prometheus, including its removal from PromQL.
People also ask

Are there approaches for capturing spikes with PromQL?
Yes, max_over_time() can be used with rate() to capture spikes. For example, max_over_time(rate(http_requests_total[5m])[1h:]) will show the maximum rate observed in 5-minute windows over the last hour.
🌐
last9.io
last9.io › blog › prometheus-rate-function
Prometheus Rate Function: A Practical Guide to Using It | Last9
How do you calculate request rates using the Prometheus rate function?
To calculate request rates, use a query like rate(http_requests_total[5m]). This will give the per-second rate of requests over the last 5 minutes. These rates can be summed or grouped as needed, e.g., sum(rate(http_requests_total[5m])) for the total request rate across all instances.
🌐
last9.io
last9.io › blog › prometheus-rate-function
Prometheus Rate Function: A Practical Guide to Using It | Last9
Can rate() be used with all types of Prometheus metrics?
No, rate() should only be used with counter-metrics. It doesn't make sense to use rate() with gauge metrics, as they don't represent cumulative values.
🌐
last9.io
last9.io › blog › prometheus-rate-function
Prometheus Rate Function: A Practical Guide to Using It | Last9
Top answer
1 of 3
24

The "increase" function calculates how much some counter has grown and the "rate" function calculates the amount per second the measure grows.

Analyzing your data I think you used [30s] for the "increase" and [1m] for the "rate" (the correct used values are important to the result).

Basically, for example, in time 2m we have:

increase[30s] = count at 2m - count at 1.5m = 4423 - 4402 = 21
rate[1m]      = (count at 2m - count at 1m) / 60 = (4423 - 4381) / 60 = 0.7

Prometheus documentation: increase and rate.

2 of 3
15

Prometheus calculates rate(count[d]) at timestamp t in the following way:

  1. It obtains raw samples per each time series with count name on the time range (t-d ... t]. Note that t-d timestamp isn't included in the range, while t timestamp is included in the range. For example, when calculating rate(count[1m]) at a timestamp t=2m the following raw samples are selected: 4423 @ 2m, 4402 @ 1m45s, 4402 @ 1m30s, 4381 @ 1m15s. Note that the 4381 @ 1m sample isn't included in calculations.
  2. Then it calculates the difference between the last and the first sample on the selected time range per each time series with the name count. Prometheus can detect and remove time series resets to zero on the selected time range, but let's skip this for now for the sake of clarity. In the case above it calculates 4423 @ 2m - 4381 @ 1m15s = 42.
  3. Then it divides results from step 2 by the duration d in seconds per each time series with name count. In the case above it calculates 42 / 1m = 42 / 60s = 0.7.

The actual result for rate(count[1m]) @ 2m - 0.700023 - differs from the calculated result - 0.7 - because of extrapolation, which can be applied to results calculated at step 2 if timestamps for the first and/or the last raw sample are located too far from the selected time range bounds. See more details about the extrapolation in this issue.

Note also that Prometheus misses possible counter increase on the time range [1m ... 1m15s] when calculating both rate() and increase(). See more details about this issue here and here.

🌐
Last9
last9.io › blog › prometheus-rate-function
Prometheus Rate Function: A Practical Guide to Using It | Last9
June 15, 2026 - The rate() function is a key component of PromQL (Prometheus Query Language) used for analyzing the rate of change in counter metrics over time.
🌐
Prometheus
prometheus.io › docs › tutorials › understanding_metric_types
Understanding metric types | Prometheus
The rate() function in PromQL takes the history of metrics over a time frame and calculates how fast the value is increasing per second.
🌐
Promlabs
promlabs.com › blog › 2021 › 01 › 29 › how-exactly-does-promql-calculate-rates
PromLabs | Blog - How Exactly Does PromQL Calculate Rates?
January 29, 2021 - Thus increase() (and also rate()) extrapolate the slope between those first and last data points under the window to the window boundaries, to arrive at a value that will on average be closer to the expected increase over the entire window (had there actually been samples precisely at the window boundaries).
🌐
PagerTree
pagertree.com › learn › prometheus › promeql › counter rates & increases
Counter Rates & Increases | PagerTree
rate() - "rate of increase" - calculates a per-second increase of a counter as averaged over a specified window. PromQL: rate() function · irate() - "instantaneous rate of increase" - calculates a per-second increase over the time window, only ...
Find elsewhere
🌐
Promlabs
promlabs.com › promql-cheat-sheet
PromLabs | PromQL Cheat Sheet
Go get our self-paced in-depth PromQL training! Select latest sample for series with a given metric name: ... Available aggregation operators: sum(), min(), max(), avg(), stddev(), stdvar(), count(), count_values(), group(), bottomk(), topk(), quantile() ... Only keep series from the left-hand side whose sample values are larger than their right-hand-side matches: ... histogram_quantile( 0.9, sum by(le, path, method) ( rate(demo_api_request_duration_seconds_bucket[5m]) ) )
🌐
SigNoz
signoz.io › guides › what is the difference between prometheus rate vs increase functions
Prometheus rate vs increase Functions Explained | SigNoz
June 23, 2026 - Rate() calculates the per-second rate of change, while increase() computes the total change over a specified time range. No, these functions are designed for counter metrics. Gauge metrics should be analyzed using different PromQL functions.
Top answer
1 of 3
21

The rate(m[d]) function calculates the increase of a counter metric m over the given lookbehind window d in square brackets and then divides the increase by d. The calculation is performed independently per each matching time series m. For example, suppose there are http_requests_total metrics with url label:

http_requests_total{url="/foo"}
http_requests_total{url="/bar"}

If they have the following values at time t0:

http_requests_total{url="/foo"} 123
http_requests_total{url="/bar"} 456

... and the following values at time t0 + 5 minutes:

http_requests_total{url="/foo"} 345
http_requests_total{url="/bar"} 789

Then rate(http_requests_total[5m]) at time t0 + 5 minutes is calculated in the following way:

  1. To calculate increase for these metrics between t0 and t0 + 5 minutes:
increase(http_requests_total{url="/foo"}[5m]) = 345 - 123 = 222
increase(http_requests_total{url="/bar"}[5m]) = 789 - 456 = 333
  1. To divide the calculated increase by 5 minutes expressed in seconds (5*60s = 300s):
rate(http_requests_total{url="/foo"}[5m]) = 222 / 300 = 0.74
rate(http_requests_total{url="/bar"}[5m]) = 333 / 300 = 1.11

So the end result of rate(http_requests_total[5m]) is a per-second average rps for the last 5 minutes, which is calculated individually per each time series with http_requests_total name.

A few notes:

  • Both rate() and increase() properly handle e.g. counter resets, when the counter is reset to zero.

  • Sometimes Prometheus can return unexpected results from rate() and increase() because of the chosen data model. See this issue. This issue is addressed in VictoriaMetrics - Prometheus-like monitoring system I work on - see this comment and this article.

  • Some PromQL-compatible query engines such as MetricsQL allow skipping the lookbehind window in square brackets when using rate() function, so rate(http_requests_total) is a valid MetricsQL query. In this case it automatically adds [$__interval] lookbehind window before query execution. See these docs for more details.

2 of 3
2

While I am not familiar with Micrometer Timer, the metric you're describing is of type Summary. It is counting the "events" in _count and summing the events magnitude, like duration, elapsed time and similar, in _sum. If you now perform rate(metric_count[5m]), you'll get the 5m average per second rate of your events. And if you want to know the average duration of these events within 5m window, you do rate(metric_sum[5m]) / rate(metric_count[5m]). If you try dividing metric_sum/metric_count, you'll get all time (since counter reset) average instead of 5m average at some point in time. In a way, it looks a bit funny to use rate() for this. Using increase() seems more intuitive to me, but mathematically it's exactly the same as rate() is just an increase()/range and so these ranges cancel each other out in rate(metric_sum[5m]) / rate(metric_count[5m]).

🌐
pint
cloudflare.github.io › pint › checks › promql › rate.html
promql/rate | pint
rate() is never called on result of sum(counter) since that will always return invalid results. Chaining rate(sum(...)) is only possible when passing a metric produced via recording rules to rate() and so pint will try to find such chains.
🌐
Chronosphere
chronosphere.io › home › top 3 queries to add to your promql cheat sheet
Top 3 queries to add to your PromQL cheat sheet
April 2, 2025 - The good news is that you can always query them using the exact same pattern as above: A histogram_quantile() call wrapping a sum() aggregation, which in turn wraps a rate() function around an input histogram. You can just copy this pattern and replace a few key parameters: The input histogram name (here: “api_request_duration_seconds_bucket”), ... The dimensions you want to split the result out by (here: “method” and “path”). This pattern is so standard that both Prometheus and Grafana will auto-complete it as a query snippet for you when you start typing “histogram_quantile” into your PromQL text input.
🌐
DoHost
dohost.us › home › 2025 › september › 28 › understanding rate vs. increase in promql
Understanding Rate vs. Increase in PromQL - DoHost
September 28, 2025 - This tutorial will explore the critical differences between the `rate()` and `increase()` functions in PromQL. We’ll delve into how each function calculates changes in time-series data, providing clear examples to illustrate their behavior. You’ll learn when to use `rate()` to smooth out counter resets and when `increase()` provides a more accurate total change over a specific time window.
🌐
DoHost
dohost.us › home › 2025 › september › 27 › using promql functions: calculating rates and averages
Using PromQL Functions: Calculating Rates and Averages - DoHost
September 27, 2025 - This tutorial provides a comprehensive guide on using PromQL functions to calculate rates and averages in Prometheus. We’ll start with the basics of rate calculation using the `rate()` function, including its syntax and usage. Then, we’ll explore the `irate()` function and discuss the differences between `rate()` and `irate()`. We’ll dive into calculating averages over time using the `avg_over_time()` function.
🌐
Medium
medium.com › @bhupender.rawat4 › demystifying-prometheus-a-deep-dive-into-rate-and-irate-ce02745231fc
Demystifying Prometheus: A Deep Dive into rate() and irate() | by Bhupender Singh Rawat | Medium
May 7, 2025 - These two functions play a crucial role in analyzing application performance, troubleshooting issues, and defining alert conditions. Whether you're investigating latency spikes, error rates, or request throughput, knowing when and how to use rate() vs irate() can dramatically improve the accuracy of your monitoring and the reliability of your alerts.
🌐
Medium
valyala.medium.com › promql-tutorial-for-beginners-9ab455142085
PromQL tutorial for beginners and humans | by Aliaksandr Valialkin | Medium
September 15, 2023 - Simplified rate calculation for each point looks like (Vcurr-Vprev)/(Tcurr-Tprev), where Vcurr is the value at the current point — Tcurr, Vprev is the value at the point Tprev=Tcurr-d. If this looks too complicated, then just remember — higher d smooths the graph, while lower d brings more noise to the graph. There is also PromQL extension supported by VictoriaMetrics, where [d] may be omitted — in this case it equals to the duration between two subsequent points on the graph (aka step):
🌐
YouTube
youtube.com › prometheus monitoring with julius | promlabs
Understanding Counter Rates and Increases in PromQL | Reset Handling, Extrapolation, Edge Cases - YouTube
In this video, I explain the exact value calculation behaviors of the rate(), irate(), and increase() functions in PromQL for computing rates of increase for...
Published: July 10, 2023
Views: 15K
🌐
Medium
medium.com › @MetricFire › how-the-prometheus-rate-function-works-cc63fe90ef19
How the Prometheus rate() function works | by MetricFire | Medium
July 31, 2023 - They do not return any results at all if there are less than two samples available. PromQL indicates range vectors by writing a time range in square brackets next to a selector which says how much time into the past it should go.
🌐
Medium
medium.com › @armanihsan224 › rate-and-increase-function-in-promql-235bba167000
rate and increase function in promQL | by Arman ihsan | Apr, 2026 | Medium
April 12, 2026 - rate() calculates the average per-second increase of a counter over a time window. Syntax · promql · rate(counter_name[time_window]) What It Returns · Instant Vector (one value per time series) Value = average requests per SECOND · How It ...
🌐
OneUptime
oneuptime.com › home › blog › how to understand rate() vs increase() in prometheus
How to Understand rate() vs increase() in Prometheus
December 17, 2025 - graph TB subgraph "Counter Values" T1["t=0: 100"] T2["t=5m: 400"] end subgraph "rate(metric[5m])" R["(400-100) / 300s = 1 req/sec"] end subgraph "increase(metric[5m])" I["400 - 100 = 300 requests"] end T1 --> R T2 --> R T1 --> I T2 --> I