Legend keys when using aliasByNode with asPercent

Hi all, I am trying to use aliasByNode with asPercent to get useful keys in the legend table.

What I am looking for is legend keys like in this example without asPercent:

When I put aliasByNode before asPercent get legend names with the formula as legend keys:

When I put aliasByNode after asPercent I get asterixes as legend keys.

How can I structure the metric query so I can use asPercent but also get the legend keys from node 5?

I should probably not that this is using graphite as a data source with keys coming in such as:
cluster.some_cluster.server.some_server.event_type.event_alpha

Maybe try and use groupByNode or use arguments to asPercent function, see http://graphite.readthedocs.io/en/latest/functions.html#graphite.render.functions.asPercent

Marcus

Thanks for the ideas. I tried using groupByNode before and after asPercent and I’m still getting the asPercent formula text instead of the node values in my legend. I’ll confess, I’ve read the docs a few times but still don’t quite understand how groupByNode works.

I get the full formula text if I place groupByNode before:

And I get some subset of the formula text if I place groupByNode after:

Sending the series and a sum of the series into asPercent as arguments doesn’t seem to have any effect on what shows up in the legend. I tried it both ways: with no arguments, and with the first argument being the series and a second argument which is a sum of the series.

I imagine showing labels with asPercent is a common use case and I’m just missing something simple…Any help is appreciated!

Hi,

Tried this out on our grafana play site now with some modified queries (link to example panel)

1st query:
aliasByNode(movingAverage(scaleToSeconds(apps.fakesite.*.counters.requests.count, 1), 2), 2)

2nd query:
aliasByNode(asPercent(#A), 2)

Please try out a similar query and see if you can get it to work

Marcus

It looks like we are using different versions of graphite but I believe I constructed a similar query below. The problem is that for some reason those node values now show up as “*”.

What Graphite version are you using? If you switch the queries to Toggle edit mode and paste them here how do they look?

Marcus