I figured this out, this has to do with the fact that Prometheus takes the [$interval] back from the start query parameter. so vector[1d]&start=Jun26th 00:00. returns the stats for Jun 25th as the first sample. With [1h] it returns the stats from June 25th 23pm to June 26th 00:00. So I’ll need to… Answer from franck102 on community.grafana.com
🌐
Grafana
community.grafana.com › t › help-with-prometheus-rollup-queries › 35742
Help with Prometheus rollup queries - Grafana - Grafana Labs Community Forums
August 27, 2020 - Hi all, I could use some help with ... a Prometheus data source. I have a memory usage gauge that tracks bytes used: pod:meter_memory_usage:joined{...}[3m] 2284568576 @1598513884.967 2284568576 @1598513914.967 ... I would like to display a bar graph of hourly, daily, or weekly rollups of those ...
🌐
Chronosphere
chronosphere.io › home › how can recording and data roll-up rules help your metrics?
How can recording and data roll-up rules help your metrics?
April 2, 2025 - Chronosphere customers who applied a roll-up rule across the Prometheus instance label often see their cardinality and persisted write volume drop from 10 to 20 times, reducing the cost of their metric platform by 10 to 20 times.
Discussions

promql - Get the increase for a prometheus metric that has been recorded as a rate - Stack Overflow
Let's say I have a metric foo_count that get's rolled up before being written to remote storage to reduce cardinality and uses this rule: - record: rollup:foo_count:1m expr: sum(rate(foo_count[1m... More on stackoverflow.com
🌐 stackoverflow.com
Prometheus and Grafana Hourly Rollup Query - Stack Overflow
I'm trying to build a graph in Grafana that aggregates a metric over hour time periods. So like there'll be aggregation for 11-12, 12-1, etc and from the start of the hour till now. I've figured ... More on stackoverflow.com
🌐 stackoverflow.com
promql - Why time duration needs double dot for Prometheus but not for Victoria metrics - Stack Overflow
What is the reason, the query is different? I always using time duration in Prometheus alerts without double dot. ... The avg_over_time is a rollup function. This function calculates results over raw samples on some interval, which starts in the past and ends at the current time. More on stackoverflow.com
🌐 stackoverflow.com
Delta rollup in Splunk - PromQL - Prometheus Monitoring System
Hello Team, I need your guidance ... the previous value, the delta is the new value, not the negative difference. which is the Prometheus function I can use to achieve delta rollup? I tr...... More on discuss.prometheus.io
🌐 discuss.prometheus.io
0
October 23, 2023
🌐
Google Groups
groups.google.com › g › prometheus-users › c › p5GZS1bKyTA
Rollup and save historical data
June 15, 2023 - Dear prometheus community, my prometheus scrapes a lot of endpoints and I only need to 10s for a month. After that I would like to rollup the data to 5m averages and after 6 months I would like to have only hourly averages. So I can have quite a long time of data and can see changes over a ...
🌐
Stack Overflow
stackoverflow.com › questions › 77530362 › get-the-increase-for-a-prometheus-metric-that-has-been-recorded-as-a-rate
promql - Get the increase for a prometheus metric that has been recorded as a rate - Stack Overflow
Let's say I have a metric foo_count that get's rolled up before being written to remote storage to reduce cardinality and uses this rule: - record: rollup:foo_count:1m expr: sum(rate(foo_count[1m...
🌐
VictoriaMetrics
victoriametrics.com › blog › prometheus monitoring: functions, subqueries, operators, and modifiers
Prometheus Monitoring: Functions, Subqueries, Operators, and Modifiers
April 25, 2025 - Instead, it uses a built-in function called default_rollup(). This function is optimized for data with irregular sample intervals and adjusts the rollup window automatically based on the data or step size. ... The engine pulls all time series named http_requests_total within the given time range from the metrics storage · Converts the instant vector http_requests_total to last_over_time(http_requests_total[lookback]) (in Prometheus) or default_rollup(http_requests_total[lookback]) (in VictoriaMetrics)
🌐
Stack Overflow
stackoverflow.com › questions › 47039346 › prometheus-and-grafana-hourly-rollup-query
Prometheus and Grafana Hourly Rollup Query - Stack Overflow
I'm trying to build a graph in Grafana that aggregates a metric over hour time periods. So like there'll be aggregation for 11-12, 12-1, etc and from the start of the hour till now. I've figured ...
🌐
Medium
valyala.medium.com › how-to-optimize-promql-and-metricsql-queries-85a1b75bf986
How to optimize PromQL in Prometheus | Medium
October 29, 2021 - There are a few exceptions such as histogram_quantile, prometheus_buckets and other histogram-related functions, which take more time and resources during the execution. Aggregate functions such as sum, count, avg, min, max. These functions are also mostly lightweight except of a few non-trivial aggregate functions such as count_values, quantile or histogram. Rollup functions such as rate, increase, min_over_time and and quantile_over_time.
Find elsewhere
🌐
VictoriaMetrics
victoriametrics.com › blog › prometheus monitoring: instant queries and range queries explained
Prometheus Monitoring: Instant Queries and Range Queries Explained
February 21, 2025 - Behind the scenes, an instant query like node_cpu_usage is automatically converted to last_over_time(node_cpu_usage[5m]) in Prometheus. In VictoriaMetrics, it becomes default_rollup(node_cpu_usage[<autogenerated_window>]) with a window generated based on your metric’s characteristics.
🌐
Last9
last9.io › blog › prometheus-logging
Prometheus Logging Explained for Developers | Last9
February 19, 2026 - High-cardinality metrics—where labels like user_id, session_id, or url have thousands of unique values, which can quickly overwhelm Prometheus’s storage and query performance. ... Aggregate at ingest: Don’t track per-user metrics unless necessary. Aggregate by region, user type, or status code. Pre-aggregate with recording rules: Store daily or hourly rollups that reduce label combinations.
🌐
Last9
last9.io › blog › how-to-manage-high-cardinality-metrics-in-prometheus
High Cardinality in Prometheus: How to Find and Fix It | Last9
June 11, 2026 - Watch prometheus_tsdb_head_series and plan to aggregate or shard well before memory pressure hits. Yes, permanently. Series are dropped or rewritten at scrape time, before storage, so there is no recovering them later. Check the label is unused in dashboards and alerts first, or pre-aggregate with recording rules so a coarser version of the data survives. Streaming aggregation keeps the rollup while skipping raw series storage.
🌐
M3 Documentation
m3db.io › docs › how_to › any_remote_storage
M3 Aggregation for any Prometheus remote write storage | M3 Documentation
In this setup we show how to run M3 Coordinator with in process M3 Aggregator as a sidecar to receive and send metrics to a Prometheus instance via remote write protocol.
🌐
Metabase
metabase.com › integrations › prometheus
Prometheus + Metabase: Build Observability Dashboards
Connect Prometheus to Metabase to analyze Service availability and error rate, Alert volume by rule, SLO burn rate. Pull live data with Prometheus's MCP route and the Metabase CLI, or sync rollups to a warehouse for durable dashboards.
Top answer
1 of 1
1

The avg_over_time is a rollup function. This function calculates results over raw samples on some interval, which starts in the past and ends at the current time. This interval is usually named lookbehind window. For example, avg_over_time(m[1h]) calculates the average value over raw samples for time series m on the interval (t-1h ... t], where t is the current time. If m returns multiple time series, then the rollup function calculates results individually per each time series.

Rollup functions expect time series selector with lookbehind window in square brackets as an argument. If something other is passed to rollup function, then the following cases are possible:

  • Prometheus returns expected type range vector in call to function "...", got instant vector if subquery isn't called explicitly. For example, such an error is returned in the following cases avg_over_time(m) or avg_over_time(sum(m)).
  • Prometheus returns ranges only allowed for vector selectors if the colon with optional step is missing in subquery's square brackets. For example, such an error is returned in avg_over_time(sum(m)[1h]).
  • Subquery execution. For example, avg_over_time(sum(m)[1h:]) would calculate the sum(m) per each point on the graph and then calculate the average over these points with one hour lookbehind window.

VictoriaMetrics doesn't return errors in these cases, since it automatically performs the needed conversions as documented here:

  • avg_over_time(m) is automatically converted to the equivalent of avg_over_time(m[$__interval]), where $__interval is the interval between adjacent points on the graph in Grafana.
  • avg_over_time(sum(m)) is automatically converted into avg_over_time(sum(default_rollup(m[$__interval]))[$__interval:$__interval])
  • avg_over_time(sum(m)[1h]) and avg_over_time(sum(m)[1h:]) are automatically converted into the same query - avg_over_time(sum(default_rollup(m[$__interval]))[1h:$__interval]).
🌐
GitHub
github.com › VictoriaMetrics › VictoriaMetrics › blob › master › app › vmselect › promql › rollup.go
VictoriaMetrics/app/vmselect/promql/rollup.go at master · VictoriaMetrics/VictoriaMetrics
"delta": newRollupFuncOneArg(rollupDelta), "delta_prometheus": newRollupFuncOneArg(rollupDeltaPrometheus), "deriv": newRollupFuncOneArg(rollupDerivSlow), "deriv_fast": newRollupFuncOneArg(rollupDerivFast), "descent_over_time": newRollupFuncOneArg(rollupDescentOverTime), "distinct_over_time": newRollupFuncOneArg(rollupDistinct), "duration_over_time": newRollupDurationOverTime, "first_over_time": newRollupFuncOneArg(rollupFirst), "geomean_over_time": newRollupFuncOneArg(rollupGeomean), "histogram_over_
Author: VictoriaMetrics
🌐
GitHub
github.com › samber › chartjs-plugin-datasource-prometheus › blob › master › rollup.config.mjs
chartjs-plugin-datasource-prometheus/rollup.config.mjs at master · samber/chartjs-plugin-datasource-prometheus
import terser from "@rollup/plugin-terser"; import pkg from "./package.json" with { type: "json" }; · const external = ["assert"]; · const banner = `/*! * ${pkg.name} v${pkg.version} * github.com/samber/chartjs-plugin-datasource-prometheus · * (c) ${new Date().getFullYear()} chartjs-plugin-datasource-prometheus Contributors ·
Author: samber
🌐
Prometheus
discuss.prometheus.io › promql
Delta rollup in Splunk - PromQL - Prometheus Monitoring System
October 23, 2023 - Hello Team, I need your guidance to identify delta rollup in Splunk, Delta: For [cumulative counter metrics, the rate is the difference between the data point for the current time interval and the data point for the …
🌐
Karlstoney
karlstoney.com › federated-prometheus-to-reduce-metric-cardinality
Federated Prometheus to reduce Metric Cardinality
July 1, 2024 - Subsequently if you're wanting to explore your data in a more free form manner (say you want to look at istio_requets_total with a rate of 10m, you'll need to do that on your collector, not on your top level prometheus. This is why you generate rollup federate:istio_requests_total:rate1m metrics on your collector, and not by doing sum(irate(federate:istio_requests_total:sum[1m])) on your master.