Search code examples
grafanagraphite

Graphite - show "time spent" chart in a intuitive way


I have a metric to collect "time spent" metric on each task. The task might be triggered every 5~60 minutes. So the collected value is always the last updated value.

e.g., 533, 533, 533, 533, 533, 533, 46, 46, 999, 999, 999 (ms)

As the collected dots above, there are three executions: 533, 46, 999

But it would become three horizontal lines if I didn't apply any function. It's a little bit not intuitive. Is there any way to always show the only first value if the following values are identical?


Solution

  • I thought I figure out how to configure the query: You can use the derivative function, a function that shows the change from the previous value. Then you can filter out zero to make it more readable.

    For example:

    removeBelowValue(derivative(your_time_spent_query), 1)
    

    Before: enter image description here

    After: enter image description here