You whole attempt has a couple flaws:

  1. If your metric is actually a counter, your query should be sum by (customer) (increase(requests[1d])).
  2. In Grafana $__interval stand for time corresponding to one "column" on time scale. Based on your description, you probably intended to use $__range instead.
  3. To get only last result of the query, and represented as actual table data, and not independent time series, you need to change options Format to Table, and Type to Instant. Those options can be seen underneath the query in your screenshot.

To hide column Time, you can use Transformation Organize field

Answer from markalex on Stack Overflow
🌐
Grafana
community.grafana.com › dashboards
How to "count the value above x and make sum over time"? - Dashboards - Grafana Labs Community Forums
November 24, 2022 - Hi, I’m using Grafana with Prometheus to monitor some smart outlets (like the microwave or TV) with watt consumption, but I also want to monitor the time that they are ON. But they’re “on” also when they are in standby, because they drain few watts but for the metrics, 0 off, 1 on.
Discussions

How to do a basic summation?
What Grafana version and what operating system are you using? Running a Docker container from the grafana/grafana image, launched 6/28/23 so likely the most recent version. What are you trying to achieve? I’m trying to sum several metrics into one total number. More on community.grafana.com
🌐 community.grafana.com
13
0
June 30, 2023
Cumulative sum over time
Hello I’m trying to simply display the cumulative sum of my rain gauge over a certain periode of time. The rain gauge has a 5min resolution , that i would like to see over one 1hour As you can see on the graphs , the cumulative sum almost work but never goes back to zero when it doesn’t ... More on community.grafana.com
🌐 community.grafana.com
3
1
January 31, 2021
prometheus - Get Total requests in a period of time - Stack Overflow
But sum(increase(http_requests_total[100y])) will get you the total value over the whole lifetime of the counter and not just the selected time interval 2020-04-17T10:29:13.067Z+00:00 ... Save this answer. ... Show activity on this post. SO won't let me comment on Yoory's answer so I have to make a new one... In Grafana ... More on stackoverflow.com
🌐 stackoverflow.com
Display sum of all gauge's values
Hello, I’m very new to Grafana and Prometheus. I’m using Grafana v8.2.6 on Windows 10, along with Prometheus. It scrapes a Gauge metric that is sent every 2 minutes. I would like to display a stat that corresponds to a running sum of all values the Gauge ever had. More on community.grafana.com
🌐 community.grafana.com
3
0
May 31, 2023
🌐
Grafana
community.grafana.com › stat panel
Sum over given time period - Stat Panel - Grafana Labs Community Forums
October 24, 2022 - Unfortunately I couldn’t find a suitable thread for my question. My electricity consumption meter shows the current consumption (VA) every second. 100 110 109 108 110 … My data is in an InfluxDB (1.8). I would like to determine the total consumption of the set period and display it with the Plugin Stat.
🌐
Grafana
community.grafana.com › dashboards
How to do a basic summation? - Dashboards - Grafana Labs Community Forums
June 30, 2023 - What Grafana version and what operating system are you using? Running a Docker container from the grafana/grafana image, launched 6/28/23 so likely the most recent version. What are you trying to achieve? I’m trying to sum several metrics into one total number.
🌐
Grafana
community.grafana.com › t › cumulative-sum-over-time › 42434
Cumulative sum over time - Grafana - Grafana Labs Community Forums
January 31, 2021 - Hello I’m trying to simply display the cumulative sum of my rain gauge over a certain periode of time. The rain gauge has a 5min resolution , that i would like to see over one 1hour As you can see on the graphs , the cumulative sum almost work but never goes back to zero when it doesn’t ...
🌐
Grafana
community.grafana.com › dashboards
Display sum of all gauge's values - Dashboards - Grafana Labs Community Forums
May 31, 2023 - Hello, I’m very new to Grafana and Prometheus. I’m using Grafana v8.2.6 on Windows 10, along with Prometheus. It scrapes a Gauge metric that is sent every 2 minutes. I would like to display a stat that corresponds to …
Find elsewhere
🌐
Grafana
community.grafana.com › dashboards
Sum of all the values for each data points - Dashboards - Grafana Labs Community Forums
August 4, 2022 - Hi , Can you pls let me know if there is any way to sum all the available values of each data points and display it. Ie in below snapshot We have 4 values for 11th April data and I want to display the sum of all these v…
🌐
Grafana
community.grafana.com › dashboards
Combine two values from a time series to produce a graph of the sum - Dashboards - Grafana Labs Community Forums
February 25, 2024 - What Grafana version and what operating system are you using? 10.3.1 What are you trying to achieve? A single line graph which represents the sum of the same field from two time series. How are you trying to ach…
🌐
Grafana
community.grafana.com › t › calculate-the-sum-of-total-requests-at-each-datapoint-after-using-increase-function › 131739
Calculate the sum of total requests at each datapoint after using increase function - Grafana - Grafana Labs Community Forums
September 11, 2024 - Is there any function in grafana if we need to add the previous value to current value and sum up the whole value. I have used increase and sum function but the I am observing same value. I need to get the count of …
🌐
Grafana
grafana.com › docs › tempo › latest › metrics-from-traces › metrics-queries › functions
TraceQL metrics functions | Grafana Tempo documentation
For more information, refer to the step API parameter. These functions accept the numerical field that you want to aggregate on. The sum_over_time() function lets you aggregate numerical values by computing the sum value of them.
🌐
Grafana
community.grafana.com › time series panel
Sum all values in an hour from a grouped time series - Time Series Panel - Grafana Labs Community Forums
December 21, 2022 - hello community i am using the open source v8.5.3 currently i have a time series data from the following query SELECT $__timeGroup(datetime, ‘15m’,0) AS time, IF(count(0) > 0, 1, 0) as value, type as metric FROM table_sensors WHERE uid = 491 group by $__timeGroup(datetime,‘15m’,0), ...
🌐
Grafana
community.grafana.com › dashboards
Gauge bar sum on range times - Dashboards - Grafana Labs Community Forums
July 10, 2023 - Hi all, I have been “fighting” with this for hours and I’m getting crazy 🙂 I have the following query and table In a time series view, it is work well: But, when I try to represent in a Gauge bar the sum of the differents values into the selected range, Grafana draws the latest value: I tried to configure the chart selection “calculation → total”, I have the sum of all the time series, from the beginning of the query, not the selected range (6h for example): Is ther...
🌐
Grafana
grafana.com › docs › loki › latest › query › metric_queries
Metric queries | Grafana Loki documentation
rate_counter(unwrapped-range): calculates per second rate of the values in the specified interval and treating them as “counter metric” · sum_over_time(unwrapped-range): the sum of all values in the specified interval.
🌐
Graphite
graphite.readthedocs.io › en › latest › functions.html
Functions — Graphite 1.2.0 documentation
Useful when you have another series where the value is a timestamp, and you want to compare it to the time of the datapoint, to render an age ... This would create a series named “The.time.series” that contains points where x(t) == t. ... This will show the sum over time, sort of like a ...
🌐
Stack Overflow
stackoverflow.com › questions › 78937272 › sum-metric-values-over-a-given-time-but-only-if-another-metric-is-above-a-certa
grafana - Sum metric values over a given time, but only if another metric is above a certain threshold - Stack Overflow
sum_over_time( ( homeassistant_sensor_power_w{entity="sensor.sonoff_1001691285_power"} and on (instance) (homeassistant_sensor_power_w{entity="sensor.sunsynk_grid_power"} > 20) )[24h:1m] ) * 60 / (3600*1000)
🌐
Reddit
reddit.com › r/prometheusmonitoring › help with promql query (sum over time)
r/PrometheusMonitoring on Reddit: Help with PromQL query (sum over time)
July 17, 2024 -

Hello,

I have this graph monitoring the bandwidth of a VLAN on a switch every 1m using SNMP Exporter, but I also what to get the total/sum data over time, so if I select the last hour it will show x amount inbound and x amount outbound.

sum by(ifName) (irate(ifHCInOctets{instance=~"192.168.200.10", job="snmp_exporter", ifName=~".*(1001).*"}[1m])) * 8

My current graph:

I'd like to duplicate and create a stat panel show how much data in total has passed over what period I choose that's all.

For the metric I'm not sure whether to use bytes(SI) or bytes(IEC), but are similar if I change to either.

Not sure how to calculate this, but I have this created for the past 1 hour.

by copying the PromQL in Grafana and changing to a stat panel and then editing to use this:

Not sure if this is ok as I'm not sure how to calculate it all, maths was never my best subject.

Any help would be great.

I think something like is close: with sum_over_time

sum by(ifName) (sum_over_time(ifHCInOctets{instance=~"192.168.200.10", job="snmp_exporter", ifName=~".*(1001).*"}[1m])) * 8

but it comes back as 85.8 Pib when it should be 85.8 TB with my calculations.

EDIT

Observium:

What Grafana shows