graphite-graph-dsl icon indicating copy to clipboard operation
graphite-graph-dsl copied to clipboard

give possibility to use substr() instead of alias() for some fields

Open lelutin opened this issue 12 years ago • 0 comments

The default behaviour of using alias() to force a meaningful label for a field really makes sense.

Although, sometimes we'd like to use graphite's abitilty to fetch a series of values instead of just one. Using alias() on a series of values traces lines for all values in the series but creates only one label for all of them.

One example of such a graph, that I was mentioning by e-mail could be that one wants to get the top 10 domains from a web server that generate the most traffic:

substr(highestAverage(nodes.*.apache.bytes, 10), 1, 2)

Since we don't know which ones will come out, we can't just enumerate the 10 fields.

It would be interesting to be able to make "field" use substr instead of alias. It could be another construct, but it would have pretty much the same properties as "field".. and it would still be possible to use the graphite functions that fetch multiple values in the :data argument to "field".

So, I would suggest having something like :substr => [being, end] in "field" to replace the alias.

lelutin avatar Jan 05 '12 00:01 lelutin