[Node Exporter] why irate/rate for network_[...]_bytes metrics?

882 views
Skip to first unread message

Matteo Dessalvi

unread,
Nov 6, 2017, 8:27:51 AM11/6/17
to Prometheus Users
Hi all.

I am a little bit confused about the use of the rate/irate functions
to track the network_{transmit,receive}_bytes metrics, exported 
through the node_exporter.

According to the exporter, these metrics are defined as gauges but then 
why I found only examples of PromQL queries using the rate/irate functions? 
Should not be necessary to use (for example) delta/idelta?

Two of the most downloaded Grafana dashboards (for Prometheus/NodeExporter)
are using the rate functions too:


I also found another example on the following (closed) Github issue:


"[...] PromQL offers a number of functions and operators to deal with gauges. 
In fact except for the handful of functions that are for use solely with counters 
(such as rate), all functions can be sanely used with a gauge."

Anybody can explain to me why there's this exception or point me to the right documentation?

Thanks in advance!

Best regards,
Matteo

Brian Brazil

unread,
Nov 6, 2017, 9:45:11 AM11/6/17
to Matteo Dessalvi, Prometheus Users
On 6 November 2017 at 13:27, Matteo Dessalvi <mdes...@gmail.com> wrote:
Hi all.

I am a little bit confused about the use of the rate/irate functions
to track the network_{transmit,receive}_bytes metrics, exported 
through the node_exporter.

According to the exporter, these metrics are defined as gauges but then 
why I found only examples of PromQL queries using the rate/irate functions? 
Should not be necessary to use (for example) delta/idelta?

A lot of the older node exporter metrics don't have the right names/types. These are in fact counters, so rate/irate is what you want.

These will be all fixed at some point, but it's a large breaking change.

Brian
 

Two of the most downloaded Grafana dashboards (for Prometheus/NodeExporter)
are using the rate functions too:


I also found another example on the following (closed) Github issue:


"[...] PromQL offers a number of functions and operators to deal with gauges. 
In fact except for the handful of functions that are for use solely with counters 
(such as rate), all functions can be sanely used with a gauge."

Anybody can explain to me why there's this exception or point me to the right documentation?

Thanks in advance!

Best regards,
Matteo

--
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 post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/c6234145-b8b5-422e-bb0f-4b2cb0d22ac7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Ben Kochie

unread,
Nov 6, 2017, 9:55:27 AM11/6/17
to Matteo Dessalvi, Prometheus Users
As Brian said, we have a ton of cruft in the node_exporter metrics that we need to cleanup.


--

Matteo Dessalvi

unread,
Nov 6, 2017, 10:01:12 AM11/6/17
to Prometheus Users
Hi all.

@Brian: Thanks a lot! Despite all, I am glad to know the problem is related to some misnamed metrics
(I thought I did not have understood correctly the documentation!).

@Ben: Thanks for pointing me to the Github issue. I was starting to look around about this and your post
saves me a lot of time :-)

Best regards,
Matteo
Reply all
Reply to author
Forward
0 new messages