Combine alias functions

Using Graphite, I draw a graph and the same thing with a time shift.

For instance:

aliasByNode(my.application.metric.$Continent.$DC.*, 4, 5, 3) aliasByNode(timeShift(my.application.metric.$Continent.$DC.*, "7d"), 4, 5, 3) 

But I would like to be able to identify the graphs (they are currently getting the same name).

How to add a prefix or suffix (or any marker) to a metric alias?

For instance:

 -- EU.PAR.pokemonCaught -- EU.PAR.pokemonCaught (last week) 
+5
source share
2 answers

Use regex with aliasSub to capture the metric of everything ( (.*) ) And change it - add the desired text ( \1 last week ). For instance.

 aliasByNode(timeShift(my.application.metric.$Continent.$DC.*, "7d"), 4, 5, 3) 

should look like

 aliasSub(aliasByNode(timeShift(my.application.metric.$Continent.$DC.*, "7d"), 4, 5, 3), "(.*)", "\1 last week") 
+8
source

You can simply use alias () to rename it as you like.

0
source

All Articles