There's no increases there, the time series appear with the value 1. If they had increased from 0 to 1 rather than nothing to 1 then increase would show a non-zero value. I'd recommend initialising your metrics with the label values you know about.

Answer from brian-brazil on Stack Overflow
🌐
GitHub
github.com › prometheus › prometheus › issues › 1673
increase() should consider creation of new timeseries as reset · Issue #1673 · prometheus/prometheus
May 27, 2016 - Right now if a time series didn't exist and comes into existence with value 1, increase() returns 0 since Prometheus doesn't know if the counter actually was increased or simply scraped for the first time.
Author: prometheus
Discussions

increase function returns null for some data points, resulting in gaps
I have complete data for "mymetric" in prometheus for every second, with no nulls. I use increase function on a counter metric over a period of 1m to see the increase for every minute: increase(mymetric[1m]). I expect a value of the increase from first to last data point of each minute. When there was no increase, I expect to see a 0... More on github.com
🌐 github.com
15
April 26, 2017
increase(...) appears to treat discontinuity as 0-value (leading to larger than expected increase)
What did you do? Attempted to use increase to see change in a value over a 24h period. What did you expect to see? In the data we see a large jump in increase which seems to correlate with a missed scrape for the service endpoint. Observ... More on github.com
🌐 github.com
11
February 16, 2018
Why sum(increase(metric[10m])) return all 0 value?
What Grafana version and what operating system are you using? grafana cloud + prom-client + node.js What are you trying to achieve? Draw a chart about a counter metric increase. How are you trying to achieve it? I tried query sum(CLS), it shows the total count correctly, but is not the increase ... More on community.grafana.com
🌐 community.grafana.com
4
0
March 19, 2025
Why does increase() return a value of 1.33 in prometheus? - Stack Overflow
We graph a timeseries with sum(increase(foo_requests_total[1m])) to show the number of foo requests per minute. Requests come in quite sporadically - just a couple of requests per day. The value th... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Reddit
reddit.com › r/prometheusmonitoring › how to deal with increase function and no data points
r/PrometheusMonitoring on Reddit: How to deal with Increase function and no data points
September 3, 2021 -

I need to use the increase function, but the metric is very rare and when service restarts the counter is null for long time. The increase metric doesn’t play nicely with the null value and I can find a solution to consider null as zero.

Increase(my_counter[1h])

Works only if there are no null data points. Any other query I tried do not work like

Increase(my_metrics[1h] or vector(0))
🌐
DoiT
doit.com › home › blog › making peace with prometheus rate()
Making peace with Prometheus rate() | DoiT
February 17, 2023 - You see, depending on how stars align if our 1-minute range buckets land just on metric change boundaries, there is no change in the metric within that bucket at all and this is exactly why rate(), together with its sister increase(), returns zeroes.
🌐
Google Groups
groups.google.com › g › prometheus-users › c › TfsMnT4E5kk
Issue with Prometheus increase()
October 6, 2022 - Let me explain with an example: ... some 10 mins or 1hr. Now, when the counter gets increased due to some transactions, since the we don't have the time series data in the past the increase function return 0 even if the counter is at some x value....
🌐
Google Groups
groups.google.com › g › prometheus-users › c › uhJ9UUAF3Hg
First value of increase(Counter[Time]) doesn't count
July 4, 2023 - The counter may have been running and incrementing for a long time, before Prometheus starts scraping it; the first value you see could represent days or years of accumulation. That's why rate() and increase() only give a value if there are two or more adjacent data points.
🌐
GitHub
github.com › prometheus › prometheus › issues › 2659
increase function returns null for some data points, resulting in gaps · Issue #2659 · prometheus/prometheus
April 26, 2017 - I have complete data for "mymetric" in prometheus for every second, with no nulls. I use increase function on a counter metric over a period of 1m to see the increase for every minute: increase(mymetric[1m]). I expect a value of the increase from first to last data point of each minute. When there was no increase, I expect to see a 0...
Author: prometheus
🌐
GitHub
github.com › prometheus › prometheus › issues › 3852
increase(...) appears to treat discontinuity as 0-value (leading to larger than expected increase) · Issue #3852 · prometheus/prometheus
February 16, 2018 - increase(...) appears to treat discontinuity as 0-value (leading to larger than expected increase)#3852 ... Attempted to use increase to see change in a value over a 24h period. ... In the data we see a large jump in increase which seems to correlate with a missed scrape for the service endpoint. ... Large increase observed around the discontinuity. ... [root@a52004ff3fe8 /]# /usr/bin/prometheus --version prometheus, version 2.1.0 (branch: HEAD, revision: 85f23d82a045d103ea7f3c89a91fba4a93e6367a) build user: root@6e784304d3ff build date: 20180119-12:01:23 go version: go1.9.2
Author: prometheus
Find elsewhere
🌐
Grafana
community.grafana.com › prometheus
Why sum(increase(metric[10m])) return all 0 value? - Prometheus - Grafana Labs Community Forums
March 19, 2025 - What Grafana version and what operating system are you using? grafana cloud + prom-client + node.js What are you trying to achieve? Draw a chart about a counter metric increase. How are you trying to achieve it? I tried query sum(CLS), it shows the total count correctly, but is not the increase count of each time span I want : Then I tried sum(increase(CLS[10m])) query.
Top answer
1 of 2
22

The challenge with calculating this number is that we only have a few data points inside a time range, and they tend not to be at the exact start and end of that time range (1 minute here). What do we do about the time between the start of the time range and the first data point, similarly the last data point and the end of the range?

We do a small bit of extrapolation to smooth this out and produce the correct result in aggregate. For very slow moving counters like this it can cause artifacts.

2 of 2
8

Prometheus calculates increase(foo_requests_total[1m]) at a timestamp t in the following way:

  1. It selects all the raw samples per each time series with foo_requests_total name on the time range (t-1m ... t]. Note that samples at the timestamp t-1m aren't included in the selection, while samples at the timestamp t are included in the selection.
  2. It calculates the difference d between the last and the first raw sample on the selected time range (Prometheus may also remove possible counter resets, but let's skip this step for the sake of clarity).
  3. It extrapolates the calculated difference d if the first and/or the last raw sample are located too far from the bounds of the selected time range.

The last step may result in fractional increase() values over integer counters as seen in the original question. See this issue for more details. Note also that increase() in Prometheus misses the difference between the first raw sample on the selected time range and the previous sample before the selected time range. This may result in smaller than expected increase() results.

Prometheus developers are going to fix these issues - see this design doc. In the mean time try VictoriaMetrics - its increase() function properly returns the expected integer result without any extrapolation over integer counters.

🌐
Google Groups
groups.google.com › g › prometheus-users › c › GLKaSYQN_gI › m › OGqeuNjhEAAJ
rate() occasionally returns zeroes on small time window change
And it describes the obvious (if slightly broken, due to Prometheus' rate() limitations) solution. But half way down, it describes a solution that was unfortunately implemented in Grafana: forced aligning of the ranges to the step. It does remove all jitter from Grafana graphs, while at the same time making it impossible (when using a range equal to $__interval) to ever see any increases that occur between the end of one range and the beginning of another.
🌐
Stack Overflow
stackoverflow.com › questions › 78143224 › prometheus-rate-returns-0-when-same-observation-for-a-while
promql - Prometheus rate returns 0 when same observation for a while - Stack Overflow
thanks for your answer, I edited my question: "For example, if I just started sending the metrics and only has 1 observation - 20ms. I would want to see 20ms and not 0." Or if I have 1 observation from multiple machines, I want to aggregate all of them and not get 0 for their rate ... Yes, prometheus' functions for counter behave somewhat unexpectedly around "start of counting".
🌐
GitHub
github.com › prometheus › prometheus › issues › 4570
increase() not return back correct value · Issue #4570 · prometheus/prometheus
September 3, 2018 - Bug Report What did you do? Calculates the increase in the time series in the range vector What did you expect to see? The increase in the time series in the range vector What did you see instead? Under which circumstances? As shown in t...
Author: prometheus
🌐
Medium
nklya.medium.com › promql-how-to-return-0-instead-of-no-data-9e49f7ccb80d
PromQL / How to return 0 instead of ‘no data’ - Nicolai Antiferov - Medium
October 26, 2025 - It will return 0 if the metric expression does not return anything. Explanation: Prometheus uses label matching in expressions. If your expression returns anything with labels, it won't match the time series generated by vector(0).
🌐
GitHub
github.com › prometheus › prometheus › issues › 12547
Increase with rollover · Issue #12547 · prometheus/prometheus
July 12, 2023 - Proposal Right now using increase for counter Metrics is very useful, however more often than not special care has to be taken when these Metrics rollover back to zero. This normally causes the increase function to return a huge negative...
Author: prometheus
🌐
Stack Overflow
stackoverflow.com › questions › 77308821 › promql-increase-doesnt-return-correct-counter-increases
prometheus - PromQL increase() doesn't return correct counter increases - Stack Overflow
Your current result of 1 is because your metrics have increased by 1 and 0 accordingly. Prometheus doesn't implicitly consider metrics to be 0 if they are missing (unless it's a reset).
🌐
GitHub
github.com › prometheus › prometheus › issues › 17824
Feature request: a query function "increase()" variant that assumes new metrics to have started at 0 before the first value · Issue #17824 · prometheus/prometheus
January 9, 2026 - As we have this type of metric behavior in multiple places, I think we could benefit from a query function that does assume, that the metric was 0 before. E.g. increase_assume_zero_start(cilium_errors_warnings_total[5m]) returns either the only sample value in the time, or a normal increase calculation.
Author: prometheus
🌐
GitHub
github.com › VictoriaMetrics › VictoriaMetrics › issues › 962
Increase() sometimes doesn't show increase for new series · Issue #962 · VictoriaMetrics/VictoriaMetrics
December 14, 2020 - Expected behavior Consistent behaviour of Increase() taking the previous point as 0, and calculate the increase accordingly.
Author: VictoriaMetrics
🌐
Prometheus
prometheus.io › docs › prometheus › 1.8 › querying › functions
Query functions | Prometheus
Returned values are from 0 to 23. ... idelta(v range-vector) calculates the difference between the last two samples in the range vector v, returning an instant vector with the given deltas and equivalent labels. ... increase(v range-vector) calculates the increase in the time series in the ...