equivalent to "abs(ideriv(quantile())" from VictoriaMetrics

44 views
Skip to first unread message

Denny Fuchs

unread,
Aug 21, 2020, 9:13:00 AM8/21/20
to Prometheus Users
Hello,

I'm new to Prometheus and trying out Thanos. I'm coming from the InfluxDB / Telegraf world and I found a Template for Grafana, which is a fork, we use for InfluxDB.  It is for Victoriametrics and uses in the Grafana template some functions, PromQL does not have.

One of them is: abs(ideriv)): On the side from VictoriaMetrics() it means: "ideriv(m) - for calculating instant derivative for m."

I have something like:

abs(ideriv(quantile(0.5,net_bytes_recv{host =~ "$server",interface =~ "(vlan|eth|bond|ens).*"}) by (host,interface)))*8

Is there a way to get the same, so that I can search/replace this function ?

cu denny

Ben Kochie

unread,
Aug 21, 2020, 9:35:58 AM8/21/20
to Denny Fuchs, Prometheus Users
That's a very weird query to be sure.

I guess it depends a lot on what net_bytes_recv is. Is the underlying data a gauge of bytes per second? Or is it a counter? 

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/74d24101-1976-4ae8-aa28-8be919d274ebn%40googlegroups.com.

Denny Fuchs

unread,
Aug 23, 2020, 5:31:54 PM8/23/20
to Prometheus Users
Hi,

in that case, its a gauge ...


and its also used for many other graphs too, like disk :-)

cu denny

Brian Brazil

unread,
Aug 23, 2020, 6:16:55 PM8/23/20
to Denny Fuchs, Prometheus Users
>in that case, its a gauge ...

That's a counter, node_network_receive_bytes_total is the equivalent in the node exporter. I take it the expression is meant to be calculating instantaneous bits received per second?

In PromQL that would be irate(net_bytes_recv{host=~"$server",interface=~"(vlan|eth|bond|ens).*"}[1m])*8

I think the quantile is a noop, and if it wasn't it'd have been preventing you from having any useful metrics as rate always needs to be first and you can't do math on quantiles. Deriv is also not safe to use with counters, it's only for gauges.
PromQL would have given you an error for this form of query, as it doesn't make sense.

> and its also used for many other graphs too, like disk :-)

You might want to look for a different dashboard to work from, that expression is not calculating bits received per second or anything else meaningful.

Brian



--

Denny Fuchs

unread,
Aug 31, 2020, 10:35:14 AM8/31/20
to Prometheus Users
Hello Brian,

thanks a lot. I've found a new dashboard, also for Telegraf with the same overall state :-)

cu denny
Reply all
Reply to author
Forward
0 new messages