Search code examples
monitoringmetricsgraphitegrafana

Offset graphite metrics by the lowest value in current time range


I have Grafana with Graphite metrics. I have a graph showing the EnqueueCount of some specific queue in ActiveMQ. The problem is that the EnqueueCount shows all values since the queue was created, so when I narrow down the time range in Grafana to "today so far", the graph looks like this:

graph

I would like it to show only values for current period - I would like the graph to always start at 0. In this case I would like to offset it by -2. There is an offset function, however it is only by constant, while I would need something like "offset by lowest value in time period".

I went through Graphite documentation, but cannot find any function which would allow me to do this.

Any ideas how I could achieve this?

Versions we use:

  • Grafana v4.2.0 (commit: 349f3eb)
  • graphite-web-0.9.12-5
  • python-carbon-0.9.12-3

Solution

  • Please use nonNegativeDerivative() function - then you will get a rate of EnqueueCount change in (your metric interval, usually it is) minute. If you want to get count again - use integral().

    So, integral(nonNegativeDerivative(EnqueueCount)) - but usually people looking for rate, then derivative is enough.