Grafana: can it graph the change in two measurements

grafanagraph

I'm trying to find a way to measure the delta of two measurements in a Grafana graph. For example, I have chart one with a plotted point 1 equal to 100 and five minutes later point 2 is 75, the second chart would plot a value of -25…the delta over five minutes from chart one. Or +25 would work for my purposes just as well.

Are there instructions on how to do that?

The database is InfluxDB. Grafana version 3.02.

Best Answer

This can be achieved using the difference() function which calculates the delta between two points.

An InfluxDB query could be:

SELECT difference(last("db_size_bytes")) FROM ...

Ref: InfluxDB Difference function