Network traffic used per day

51 views
Skip to first unread message

Mario Pranjic

unread,
Aug 29, 2020, 4:44:32 AM8/29/20
to Prometheus Users
Hi,

I have panel showing network send/receive network traffic as follows:
rate(node_network_receive_bytes_total{instance="proxy.yggdrasil.local:9100", device="ens3"}[1m])
rate(node_network_transmit_bytes_total{instance="proxy.yggdrasil.local:9100", device="ens3"}[1m])

I need one to show network traffic summarized per day.
Whatever I tried, I ended-up with bits and pieces, and not proper one number per day.

I collect in Prometheus and visualize in Grafana.

How to accomplish this?

Thanks in advance!

Best regards,

Mario.

Aliaksandr Valialkin

unread,
Aug 29, 2020, 12:06:26 PM8/29/20
to Mario Pranjic, Prometheus Users
Hi Mario!

Try the following query:

sum(max_over_time(increase(node_network_receive_bytes_total[1d])[1d:1d])) by (instance,device)

It will return summary per-day incoming traffic for each device for every instance. Note that dates on the graph are shifted by one day, i.e. the value for the current day on the graph corresponds to the value for the previous day.
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAE%2BvKfAqZgd8YDGBojXmDXhvAdwO0CVMnxzO-98tdhy-h0gcVQ%40mail.gmail.com.


--
Best Regards,

Aliaksandr Valialkin, CTO VictoriaMetrics

Mario Pranjic

unread,
Sep 1, 2020, 5:21:05 AM9/1/20
to Aliaksandr Valialkin, Prometheus Users
Hi,

Thanks for the tip.

I am playing with sum and increase trying to get a gauge with value for the current day.

So, basically, I test:
sum(increase(node_network_transmit_bytes_total{instance="proxy.yggdrasil.local:9100", device="ens3"}[5m]))

I set "Today" on time range which looks ok:
2020-09-01 00:00:00 to 2020-09-01 23:59:59

What puzzles me is why values differ so much when I change interval on increase function. 
1min: 1628203
5min: 8129615

Shouldn't sum over those increments be the same for period of current day regardless of rate for increase function?

Mario.

lør. 29. aug. 2020 kl. 18:06 skrev Aliaksandr Valialkin <val...@gmail.com>:
Hi Mario!

Try the following query:

sum(max_over_time(increase(node_network_receive_bytes_total[1d])[1d:1d])) by (instance,device)

It will return summary per-day incoming traffic for each device for every instance. Note that dates on the graph are shifted by one day, i.e. the value for the current day on the graph corresponds to the value for the previous day.


On Saturday, August 29, 2020, Mario Pranjic <mario....@gmail.com> wrote:
Hi,

I have panel showing network send/receive network traffic as follows:
rate(node_network_receive_bytes_total{instance="proxy.yggdrasil.local:9100", device="ens3"}[1m])
rate(node_network_transmit_bytes_total{instance="proxy.yggdrasil.local:9100", device="ens3"}[1m])

I need one to show network traffic summarized per day.
Whatever I tried, I ended-up with bits and pieces, and not proper one number per day.

I collect in Prometheus and visualize in Grafana.

How to accomplish this?

Thanks in advance!

Best regards,

Mario.

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages