Merge aliasByNode and aliasByMetric in Grafana backed by Graphite

Jakub Kubrynski picture Jakub Kubrynski · Jul 9, 2016 · Viewed 7.1k times · Source

I want to label series by hostname + metric name. I know I can use aliasByNode(1) to do first part and aliasByMetric() to do the second. Any ideas how can I merge those two functions in a single metric?

Answer

Daniel Lee picture Daniel Lee · Jul 12, 2016

aliasByNode can take multiple arguments.

aliasByNode(apps.fakesite.web_server_01.counters.requests.count, 2,5)

returns web_server_01.count.

The Grafana query editor for Graphite does not support this but if you toggle edit mode then you can edit the raw query. After editing it, you can toggle back.

Toggle Edit Mode

enter image description here

End Result