ripienaar/gdash

Improved support for mostDeviant function

jbraeuer opened this issue · 2 comments

The mostDeviant function in graphite is currently poorly supported. I use it to graph the "top5 tenants" or alike. However gdash forces to give a name in the field-function, so the legend of the graph shows 5-times the same name.

It would be really cool to see this function properly supported.

Gdash supports Graphite's aliasSub function that solves this problem. For instance, in one of my .graph files I have

field :systemlog, :data  => "mostDeviant(5,nonNegativeDerivative(keepLastValue(servers.[acrpf]*ca*.filesize.derive-system_log.value)))",
  :alias_sub_search  => '^.*servers.([0-9a-z_-]*)\..*$',
  :alias_sub_replace => '\1'

This will submatch in the mostDeviant target list for servers.some-alphanumeric_servername and use that in the legend.

Thanks! This should do it indeed.