Search code examples
derivativeinfluxdb

How can I get a time series graph of the derivative of a data set using Grafana and InfluxDB


I have a process which loads RXBYTES and TXBYTES from a Linux server's interface info every 5 seconds... I would like to create a graph in Grafana which will show JUST the difference between each data point..

I.E.: (target point - previous point)/time interval

It looks like the derivative() function in InfluxDB should do exactly this, but I cannot get it to work. The query I built in Grafana is like this:

select derivative(value) from "stats.bandwidth.home.br0.rx.gauge" where time>now() - 1h group by time(10s) order asc

The results of that query are an empty set from the InfluxDB web console?!?! When I change the interval from 10s to 30s, I get just the timestamp and an empty column for the derivative as the result??? Increasing the interval further just returns similar timestamp lists with the value empty

Any help would be GREATLY appreciated...


Solution

  • Until recently, the derivative function in InfluxDB was broken. In the newest versions it works fine.