I'm trying to use the integrate function in Prometheus using functional victoria_metrics to control the time period via the functionality Grafana (in the upper right corner of the page). But this control is not working. To calculate the total amount of traffic (total byte), I have to use variable "interval": 5m, 15m, 30m, 1h, 3h, 6h ... 1 day, 2 days, a week, etc. to display information on the dashboard about the amount of traffic for the required period.
As a result, I have to use the selection of the time period in Grafana to setup needed time period, for example: 07/20/2020 - 07/26/2020 (7 days) and additionall I'm using my variable: 7 days.
It's so awkward.. How to use only Grafana interface? For bandwidth graphs this works.
My query:
integrate(outbound{location="city1"}[$timeframe])/8/(1024^3)
Raw data comes in gbit/sec. Bandwidth metric of network interface works with query
outbound{location="city1"}
Try substituting [$timeframe]
with [$__range]
in the query. The $__range
is a special Grafana variable that equals to the selected time period. See the docs about $__range variable for more details.