7

I am new to Graphite and can't understand how to do this:

I have a large number of time-metrics (celery metrics) in format stats.timers.*.median

I want to show:

  1. Top N metrics with average value above X
  2. Display them on one graph with the names of metrics

Now I have averageAbove(stats.timers.*.median,50) but it displays graphs without names and renders strangely and in bad scale. Help, please! :)

Ellochka Cannibal
  • 1,750
  • 2
  • 19
  • 31

1 Answers1

13

You will need to chain a few functions together in order to get the desired result.

limit(sortByMaxima(averageAbove(stats.timers.*.median, X)), N)

Starting the the averageAbove as the base.

The next thing you want to do is get all the metrics in order, "top-to-bottom" by using sortByMAxima.

Then you can limit the results that are rendered with the limit function.

You might not be rending the legend if you have too many metrics for the size of the graph. You can do 3 things.

  • Make the graph larger
  • Reduce the number of metrics using limit
  • Force the legend to be displayed via hideLegend
dannyla
  • 1,960
  • 14
  • 13
  • I was wondering what the performance of this would be over 100 metrics vs 1000 metrics vs 10000 metrics and so forth. We currently have 70k sources for the same metric that we're trying to get the topN on to determine which of the 70k sources is the biggest offender. seems like this is taking serious churn. wasn't sure if you had any guidance on making the performance better :) – Tony Meng Apr 19 '14 at 00:54
  • Try a high percentile on a shorter timeframe. then you can use removeBelowPercentile if you need to filter the results more. – dannyla Apr 19 '14 at 04:54