There are no interrelations between these two settings. For example, if rate(http_requests_total{job="api-server"}[5m]) is your PromQL query, it yields a single value when you execute it at a specific point in time. If you have a Grafana dashboard with a 2h time range, then Grafana just repeatedly executes this query at a series of point in times during the past 2 hours, and displays you the result of each query as e.g. a graph.

For example, if the time range of your Grafana dashboard is 2h and the interval is set to 1 minute, then Grafana executes your query 120 times during the time span ranging the past 2 hours. The results of all these queries form a graph and that's what you see in your Grafana dashboard.

The interval with which Grafana executes the query is determined by the Max data points and Min interval settings in the Query options of your Grafana dashboard:

See the explanations about these settings in the Grafana documentation.

Note: Grafana uses the query_range endpoint of the Prometheus API to repeatedly execute the query over the given time range.

Answer from weibeld on Stack Overflow
🌐
Last9
last9.io › blog › grafana-rate-function
Why Grafana's Rate Function Is Your Dashboard's Best Kept Secret | Last9
April 25, 2025 - When you use a rate() function in a Grafana dashboard, it sends the PromQL query to your Prometheus server, which calculates the rates and returns the results. Grafana then renders these rate values as graphs, making it easy to visualize how ...
🌐
Reddit
reddit.com › r/grafana › is it possible to create a graph to calculate the change rate over a certain time frame?
r/grafana on Reddit: Is it possible to create a graph to calculate the change rate over a certain time frame?
January 6, 2023 -

I have multiple graphs for all the log sources, I want to know when one changes drastically. The option to set thresholds for each log source does not support the current version, so I need to work around it. I want to create a graph for which would calculate the change rate over a certain time-frame. The idea is to create a graph in place which shows the change rate (in %) and alarm me if it’s too high.

Any idea on how to do this?

The grafana version is 7.5.15

Top answer
1 of 2
2
Not natively but with SQL code you can. Or just set up an alert.... Those can calculate based on a timeframe.
2 of 2
1
There are a few ways do to this, one is hacky and one is the "right" way. They both ultimately rely on what your data source is. 1) The Hack: long time ranges and derivatives in Grafana This is what I am doing now. I don't like it, but I haven't gotten around to implementing #2 below. The concept is you take the derivative of the same data you're already graphing, which gives you the rate of change. Then, you can alert if that graph gets too high or too low. The reason I say this is a hack is you are required to set your time span in grafana to a long enough range that it can aggregate change over time. If you normally have grafana set to 6 hours but want it to aggregate the prior 10 hours, this won't work. I've successfully used this method with InfluxQL and Prometheus queries. 2) The right way: Storing the data in your Data Source This method will depend on the data source having the specific feature I'm about to describe. InfluxDB calls them "continuous queries", Prometheus calls them "recording rules", but they're functionally similar. In both cases, what you're doing is writing a new query that takes the same query from option 1, but writes it back to InfluxDB directly. This happens completely outside of Grafana. Then, you can graph this new value natively as a normal value, and the best part is it doesn't rely on any grafana funny stuff. So you'll have a metric for my_value and another, separate metric for my_value_change_rate or something. Another benefit of this technique is you are storing this data permanently, so you can use it later if needed for other things. The last benefit I can think of is you're reducing the load on your InfluxDB server when you load your dashboard, because there are no complex long-running queries being calculated. This is especially pronounced as you increase the length of time.
Custom state timeline graph Oct 20, 2022
r/grafana
3y ago
Grafana custom metrics Dec 3, 2021
r/sysadmin
4y ago
Time series x axis scale Sep 14, 2021
r/grafana
5y ago
More results from reddit.com
Discussions

How does prometheus rate works with grafana? - Stack Overflow
For example, if the time range of your Grafana dashboard is 2h and the interval is set to 1 minute, then Grafana executes your query 120 times during the time span ranging the past 2 hours. More on stackoverflow.com
🌐 stackoverflow.com
How to plot the rate of change or the incline of a line plot?
Hi there, there is probably some statistic or mathematical concept I am missing here. I’m plotting AWS/Billing Estimated charges in Grafana, but I am having a hard time determining if the slope if increasing or not. Basically I want to plot the graph in such a way, that I am aware of the ... More on community.grafana.com
🌐 community.grafana.com
7
0
February 11, 2019
Show percentage change from this period to the previous period
I have a mysql database with a list of records and hoping to get a stat that shows the percentage change of the count of the submissions in the current time period compared to the same period before it. e.g., If we are viewing this week we would see percentage change from this week compared ... More on community.grafana.com
🌐 community.grafana.com
3
0
May 19, 2021
"Show percent change" on version 10.3
What Grafana version and what operating system are you using? 10.3.1 running on kubernetes What are you trying to achieve? I need to explain to my boss how this value is calculated. How are you trying to achieve it? I need to explain to my boss how this value is calculated. More on community.grafana.com
🌐 community.grafana.com
1
1
February 26, 2024
🌐
MetricFire
metricfire.com › blog › understanding-the-prometheus-rate-function
How the Prometheus rate() function works | MetricFire
March 12, 2026 - In Prometheus's query language, PromQL, the rate() function is used to determine the average per-second rate of increase of a counter metric over a given time range. It is particularly useful for understanding the behavior of metrics that are ...
🌐
Grafana
grafana.com › whats-new › 2024-01-05-view-percent-change-in-stat-visualizations
View percent change in stat visualizations | Grafana Labs
January 5, 2024 - You can now view percent change in stat visualizations. This makes it easier to understand your data by showing how metrics are changing over time.
🌐
Grafana
community.grafana.com › t › how-to-plot-the-rate-of-change-or-the-incline-of-a-line-plot › 14334
How to plot the rate of change or the incline of a line plot? - Grafana Labs Community Forums
February 11, 2019 - Hi there, there is probably some statistic or mathematical concept I am missing here. I’m plotting AWS/Billing Estimated charges in Grafana, but I am having a hard time determining if the slope if increasing or not. Basically I want to plot the graph in such a way, that I am aware of the ...
🌐
Grafana
play.grafana.org › d › Zb3f4veGk › stats
Grafana
Grafana is starting up · JavaScript is required to run Grafana · Please enable JavaScript in your browser and reload the page
Find elsewhere
🌐
Grafana
grafana.com › docs › grafana › latest › visualizations › panels-visualizations › query-transform-data › calculation-types
Calculation types | Grafana documentation
The following table contains a list of calculations you can perform in Grafana. You can find these calculations in the Transform tab and in the bar gauge, gauge, stat, and table visualizations. ... In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics. ... In this webinar, you'll learn how to design stylish and easily accessible Grafana dashboards that tell a story.
🌐
Grafana
grafana.com › docs › grafana › latest › visualizations › panels-visualizations › visualizations › stat
Stat | Grafana documentation
Display aggregated data, such as the average response time of your services. Highlight values above your normal thresholds to quickly identify if any metrics are outside your expected range. ... With Grafana Play, you can explore and see how it works, learning from practical examples to accelerate your development. This feature can be seen on Stat Visualizations in Grafana. ... Once you’ve created a dashboard, the following video shows you how to configure a stat visualization:
🌐
Grafana
community.grafana.com › t › show-percentage-change-from-this-period-to-the-previous-period › 47745
Show percentage change from this period to the previous period - Grafana - Grafana Labs Community Forums
May 19, 2021 - I have a mysql database with a list of records and hoping to get a stat that shows the percentage change of the count of the submissions in the current time period compared to the same period before it. e.g., If we are viewing this week we would see percentage change from this week compared ...
🌐
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 - Check the Grafana dashboard for visual representation. ... Once you add the datasource. Import the dashboard using dashboard.json content present in the repository. You will see three visualization panel as shown below. Below is the representation of following panels. total http request count [testpath_requests_total] ... both rate() and irate() are essential functions for analyzing counter metrics in Prometheus, but they serve different purposes.
🌐
QuestDB
questdb.com › blog › increase-grafana-refresh-rate-frequency
How to increase Grafana refresh rate frequency | QuestDB
December 3, 2025 - If you typically refresh once every ... Auto refresh field: To change, add, remove frequencies to the list, simply edit the list of time intervals....
🌐
ADHDecode
adhdecode.com › home › observability & monitoring › dashboarding and visualization › grafana advanced features
Grafana Advanced Features — How It Works | ADHDecode
March 19, 2026 - It’s leveraging Grafana’s templating engine to build truly dynamic observability. Alerts. The thing that wakes you up. The thing that causes meetings. Most people set up alerts based on simple thresholds. "CPU > 80%". This is how you get alerted when your system is already struggling. It’s like calling the fire department when the smoke detector is already screaming. The advanced trick here is alerting on the rate of change of problems, not just the problems themselves.
🌐
Grafana
community.grafana.com › dashboards
Calculating percent value over time range - Dashboards - Grafana Labs Community Forums
April 16, 2023 - What Grafana version and what operating system are you using? V 9.3.2. on Raspberry Debian GNU/Linux 11 (bullseye) What are you trying to achieve? My influxdb database is logging toltalizer values for SolarEnergy and ConsumedEnergy (and a few more) What I like to have is: The amount of energy produced, consumed within the selected time period the average percentage of the SolarEnergy / ConsumedEnergy over the whole selected time period.
🌐
Timesofcloud
timesofcloud.com › home › prometheus grafana
Prometheus & Grafana — Rate & Increase -
March 30, 2026 - Best Practice: Use rate() for alerts (avoids false positives from spikes). Use irate() only for real-time dashboards where you want to see spikes.
🌐
Grafana
grafana.com › docs › grafana-cloud › observe-and-act › agent-observability › guides › dashboards
Use built-in dashboards | Grafana Cloud documentation
Use the time picker to set the query window. The refresh picker next to the time picker lets you set an auto-refresh interval (for example, 30s, 1m, 5m) so dashboards update automatically without a manual reload.