delta will fail when your counter will be reset (when it will start counting from 0 again), while increase/rate will detect that and adjust result accordingly. So with:

t0: 5
t1: 11
t2: 28
t3: 4
t4: 40

with delta you'll probably get 40 - 5 = 35, while increase will probably calculate something similar to (28-5)+40 = 63

Answer from bjakubski on Stack Overflow
🌐
GitHub
github.com › prometheus › prometheus › discussions › 13900
inconsistency in prometheus rate/increase/deriv/delta calculation · prometheus/prometheus · Discussion #13900
April 6, 2024 - Hi , While reviewing Prometheus-related content online, I've come to understand that the rate / deriv is calculated as (v2 - v1) / (t2 - t1), and the increase/delta is simply (v2 - v1). Now, co...
Author: prometheus
Discussions

Proposal for improving rate, increase, delta (based on xrate, xincrease)
Proposal Building on the excellent work of Alin Sinpalean discussed in #3806 and #12386, I would like to propose a variation that makes these improvements: results are linear (meaning that the sum ... More on github.com
🌐 github.com
13
October 11, 2023
math - Prometheus increase() and delta() functions returning results that are exactly x2 higher than expected - Stack Overflow
I thought it might be due to having ... of the graph that has only one series, the increase() and delta() functions are still off by a factor of x2. ... Consistency of the error, especially between delta and increase (which AFAIK work completely differently internally) implies some systemic error, most likely on the Prometheus ... More on stackoverflow.com
🌐 stackoverflow.com
Incorrect handling of metrics by the delta() function in Grafana
I am using prometheus-cpp library , Prometheus v2.34, Grafana v8.4.5 and operating system Windows 10. And I want to calculate the intensity of my application. This application processes files. I count the processing time of each file and send it to Prometheus as a counter.Increment(Processed_time). More on community.grafana.com
🌐 community.grafana.com
2
0
May 22, 2022
Do I understand Prometheus's rate vs increase functions correctly? - Stack Overflow
I have read the Prometheus documentation carefully, but its still a bit unclear to me, so I am here to get confirmation about my understanding. (Please note that for the sake of the simplest examples More on stackoverflow.com
🌐 stackoverflow.com
🌐
Google Groups
groups.google.com › g › prometheus-users › c › Naa9PzAUvis
delta in promql vs Grafana delta on dashboard
July 1, 2023 - Use `$__rate_interval` to make sure you get enough samples for `delta()` to work. (delta(), rate(), increase(), function similarly). ... To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/63cf733e-87bd-4530-9531-5a3a29556d8an@googlegroups.com.
🌐
GitHub
github.com › prometheus › prometheus › issues › 12967
Proposal for improving rate, increase, delta (based on xrate, xincrease) · Issue #12967 · prometheus/prometheus
October 11, 2023 - Here is a Design Doc with a detailed explanation including examples: Prometheus yrate (yrate, yincrease, ydelta): Linear versions of rate(), increase() and delta(), based on xrate() We have been running a fork of Prometheus (and Thanos) for about 6 months now that has these improvements and it has been working great for us. That was important because we had run into all of the above limitations since converting our metrics stack from Graphite to Prometheus.
Author: prometheus
🌐
Grokipedia
grokipedia.com › increase and delta functions (prometheus)
Increase and delta functions (Prometheus) — Grokipedia
January 14, 2026 - For instance, applying delta() to counters may misinterpret resets as decreases, causing false negatives, while applying increase() to gauges may incorrectly assume monotonicity, leading to false positives. Proper selection based on metric type ensures thresholds reflect true behavior, enhancing the reliability of Prometheus-based monitoring systems.
🌐
ADHDecode
adhdecode.com › articles › prometheus › prometheus-increase-vs-delta-functions
Prometheus increase() vs delta(): Use the Right Function (2026) | ADHDecode
If the counter has never been seen before, increase() will return 0. It needs at least two data points to calculate an increase. This is usually not an issue in practice as Prometheus typically scrapes metrics regularly, providing multiple points. The most common mistake is using delta() when you should be using increase().
🌐
Chris's Wiki
utcc.utoronto.ca › ~cks › space › blog › sysadmin › PrometheusDeltaVsOffset
Chris's Wiki :: blog/sysadmin/PrometheusDeltaVsOffset
March 24, 2019 - You can't replace an increase() with an offset unless you're willing to ignore any errors caused by counter resets. If you're doing ad-hoc queries, you probably need to narrow down the number of metric points you're trying to load by using labels and so on. And if you really want to know, say, the average interface bandwidth for a specific network interface over an entire year, you may be plain out of luck until you put more RAM in your Prometheus server and increase its query limits.)
🌐
Promlabs
promlabs.com › blog › 2021 › 01 › 29 › how-exactly-does-promql-calculate-rates
PromLabs | Blog - How Exactly Does PromQL Calculate Rates?
January 29, 2021 - Note that we will only look at the above-mentioned counter-related functions here. If you want to track the increase or decrease of a gauge metric, you will need to use the delta() or deriv() functions for that instead.
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › 79269736 › prometheus-increase-and-delta-functions-returning-results-that-are-exactly-x
math - Prometheus increase() and delta() functions returning results that are exactly x2 higher than expected - Stack Overflow
I thought it might be due to having two result series in my metrics, but even if I zoom in to a section of the graph that has only one series, the increase() and delta() functions are still off by a factor of x2. ... Consistency of the error, especially between delta and increase (which AFAIK work completely differently internally) implies some systemic error, most likely on the Prometheus side.
🌐
Google Groups
groups.google.com › g › prometheus-users › c › PZ-fnZxSpOk
looks like rate/irate/delta/increase are not calculating consistent
January 28, 2021 - You can find the exact details ...rometheus/prometheus/blob/275f7e7766f80648d6e63ed968685f3963b494e9/promql/functions.go#L55-L131 · Short summary is: rate() / increase() will give you on-average decent approximation of the actual rate of increase by extrapolating to the window boundaries. ... I think rate/irate/delta/increase are ...
🌐
Grafana
community.grafana.com › prometheus
Incorrect handling of metrics by the delta() function in Grafana - Prometheus - Grafana Labs Community Forums
May 22, 2022 - I am using prometheus-cpp library , Prometheus v2.34, Grafana v8.4.5 and operating system Windows 10. And I want to calculate the intensity of my application. This application processes files. I count the processing time of each file and send it to Prometheus as a counter.Increment(Processed_time).
🌐
Medium
medium.com › @texasdave2 › using-delta-in-prometheus-differences-over-a-period-of-time-c72a6182c426
Using delta in Prometheus, differences over a period of time | by David O'Dell | Medium
July 15, 2019 - Using delta in Prometheus, differences over a period of time You will at some point need to figure out the difference in the values of a metric over a certain period of time. We had a problem once …
🌐
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 - Now, using either the Prometheus UI or Grafana Explore, we can inspect each metric and its corresponding values in real time. In the visual diagram below, you’ll see that we’re querying the same metric we discussed earlier — http_requests_total — and filtering for data within the last 1 hour. ... Since http_requests_total is a counter metric, its value increases every time a request hits a specific path.
🌐
Prometheus
prometheus.io › docs › prometheus › latest › querying › functions
Query functions | Prometheus
Elements in v where one of the ... idelta should only be used with gauges (for both floats and histograms). increase(v range-vector) calculates the increase in the time series in the range vector....
Top answer
1 of 3
273

In an ideal world (where your samples' timestamps are exactly on the second and your rule evaluation happens exactly on the second) rate(counter[1s]) would return exactly your ICH value and rate(counter[5s]) would return the average of that ICH and the previous 4. Except the ICH at second 1 is 0, not 1, because no one knows when your counter was zero: maybe it incremented right there, maybe it got incremented yesterday, and stayed at 1 since then. (This is the reason why you won't see an increase the first time a counter appears with a value of 1 -- because your code just created and incremented it.)

increase(counter[5s]) is exactly rate(counter[5s]) * 5 (and increase(counter[2s]) is exactly rate(counter[2s]) * 2).

Now what happens in the real world is that your samples are not collected exactly every second on the second and rule evaluation doesn't happen exactly on the second either. So if you have a bunch of samples that are (more or less) 1 second apart and you use Prometheus' rate(counter[1s]), you'll get no output. That's because what Prometheus does is it takes all the samples in the 1 second range [now() - 1s, now()] (which would be a single sample in the vast majority of cases), tries to compute a rate and fails.

If you query rate(counter[5s]) OTOH, Prometheus will pick all the samples in the range [now() - 5s, now] (5 samples, covering approximately 4 seconds on average, say [t1, v1], [t2, v2], [t3, v3], [t4, v4], [t5, v5]) and (assuming your counter doesn't reset within the interval) will return (v5 - v1) / (t5 - t1). I.e. it actually computes the rate of increase over ~4s rather than 5s.

increase(counter[5s]) will return (v5 - v1) / (t5 - t1) * 5, so the rate of increase over ~4 seconds, extrapolated to 5 seconds.

Due to the samples not being exactly spaced, both rate and increase will often return floating point values for integer counters (which makes obvious sense for rate, but not so much for increase).

2 of 3
50

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

  1. It selects raw samples for the counter time series on the time range (t-d ... t]. Note that the t-d timestamp isn't included in the time range, while t timestamp is included in the time range. If the selected time range contains less than two raw samples, then Prometheus returns an empty value (a gap) at the timestamp t.
  2. Then it calculates the increase of the selected raw samples. Usually it is calculated as the difference between the last selected sample and the first selected sample. Calculations become slightly complicated if the counter was reset to zero during the selected time range. Let's skip this for the sake of clarity.
  3. Then the resulting increase can be extrapolated if timestamps for the first and/or the last raw samples are located too far from the bounds of the selected time range.
  4. Then the rate is calculated by dividing the extrapolated increase by d.

Prometheus calculates increase(counter[d]) in the same way except the last step.

Let's look at a few examples applied to the original data:

second   counter_value    increase calculated by hand(call it ICH from now)
1             1                    1
2             3                    2
3             6                    3
4             7                    1
5            10                    3
6            14                    4
7            17                    3
8            21                    4
9            25                    4
10           30                    5
  • The rate(counter[1s]) will return nothing at any timestamp t, since any time range (t-1s ... t] contains only a single raw sample, while Prometheus requires at least two samples for calculating both rate() and increase().

  • The rate(counter[2s]) and increase(counter[2]) would return the following values per each timestamp t when extrapolation isn't applied:

t       counter_value    rate(counter[2s])        increase(counter[2s])
1             1                    -                       -
2             3               (3-1)/2=1.0                3-1=2
3             6               (6-3)/2=1.5                6-3=3
4             7               (7-6)/2=0.5                7-6=1
5            10              (10-7)/2=1.5               10-7=3
6            14             (14-10)/2=2                14-10=4
7            17             (17-14)/2=1.5              17-14=3
8            21             (21-17)/2=2                21-17=4
9            25             (25-21)/2=2                25-21=4
10           30             (30-25)/2=2.5              30-25=5

In reality Prometheus results for rate(counter[2s]) and increase(counter[2s]) may be slightly bigger because of extrapolation, since the first sample on the selected time range is located comparatively far from the start of the time range.

Such calculations have the following issues:

  • Prometheus can return fractional results from increase() over time series, which contains only integer values. This is because of extrapolation. For example, Prometheus may return fractional results from increase(http_requests_total[5m]).

  • Prometheus returns empty results (aka gaps) from increase(counter[d]) and rate(counter[d]) when the lookbehind window d doesn't cover at least two samples - see rate(counter[1s]) and increase(counter[1s]) example above.

  • Prometheus completely misses the increase between the raw sample just before the (t-d ... t] interval and the first raw sample on this interval. This may result in inaccurate calculations. For example, increase(counter[1h]) doesn't equal to sum_over_time(increase(counter[1m])[1h:1m]).

Prometheus developers are aware of these issues - see this link. These issues are addressed in the system I work on - VictoriaMetrics - more specifically, in MetricsQL query language - see this comment and this article for technical details.

🌐
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 per-second average change; increase() shows total change over time. Both functions are essential for analyzing counter metrics in Prometheus.
🌐
Google Groups
groups.google.com › g › prometheus-users › c › bHHO8mA7rN4
The result of delta function is not same with raw data?
November 20, 2020 - You're probably looking for increase. ... But, delta value cannot show the real differences between time series, output is always little bit bigger than real defferences. Following is the query and result using grafana. When I use prometheus directly, it also similar result using 15s ~ 1m interval.
🌐
Google Groups
groups.google.com › g › prometheus-users › c › WvUYBfd4pPg
Delta only for gauges?
April 5, 2017 - delta() and deriv() are for gauges, as they don't interpret non-monotonically increasing values as resets. So you can see e.g. how much a temperature has changed in the last 1h, or see how disk usage is trending. ... -- You received this message because you are subscribed to the Google Groups ...
🌐
GitHub
github.com › prometheus › prometheus › issues › 2637
Increase/Delta/Rate functions · Issue #2637 · prometheus/prometheus
April 18, 2017 - I am experimenting prometheus and came across a case where numbers does not make sense. Scrape Interval: 30s Range duration: 60s (Every range vector contains 2 points for per serie) When I use increase function, I have results doubled. I mean actual difference is 5 but result is 10.
Author: prometheus