Is it possible to alter the Legend titles ?

Asked by Chris Rutter

Is it possible to change the title of the graph lines in the legend?

For example: https://img.skitch.com/20120514-cfyeaa46nqdykx1e9xtrb7b8hp.png
I used the following render call to generate the above graph: render?from=-1d&target=stats.gauges.ops.instance_counts.st.us-east-1.*&width=650&height=300

You can see my legend titles are quite lengthy due to the the fact they are in a bucket that is a number of folders deep.
So rather then have:
stats.gauges.ops.instance_counts.st.us-east-1.Total
stats.gauges.ops.instance_counts.st.us-east-1.m1_large
stats.gauges.ops.instance_counts.st.us-east-1.c1_medium
stats.gauges.ops.instance_counts.st.us-east-1.m1_small

I would prefer if I could change the their titles respectively to:
Total
m1_large
c1_medium
m1_small

Is this possible?

Thanks,
-Chris

Question information

Language:
English Edit question
Status:
Solved
For:
Graphite Edit question
Assignee:
No assignee Edit question
Solved by:
Chris Rutter
Solved:
Last query:
Last reply:
Revision history for this message
Brian Hatfield (bmhatfield) said :
#1

Chris,

You're looking for the "alias()" function.

http://graphite.readthedocs.org/en/latest/functions.html#graphite.render.functions.alias

Brian

On Sun, May 13, 2012 at 10:30 PM, Chris Rutter <
<email address hidden>> wrote:

> New question #197125 on Graphite:
> https://answers.launchpad.net/graphite/+question/197125
>
> Is it possible to change the title of the graph lines in the legend?
>
> For example:
> https://img.skitch.com/20120514-cfyeaa46nqdykx1e9xtrb7b8hp.png
> I used the following render call to generate the above graph:
> render?from=-1d&target=stats.gauges.ops.instance_counts.st.us-east-1.*&width=650&height=300
>
> You can see my legend titles are quite lengthy due to the the fact they
> are in a bucket that is a number of folders deep.
> So rather then have:
> stats.gauges.ops.instance_counts.st.us-east-1.Total
> stats.gauges.ops.instance_counts.st.us-east-1.m1_large
> stats.gauges.ops.instance_counts.st.us-east-1.c1_medium
> stats.gauges.ops.instance_counts.st.us-east-1.m1_small
>
> I would prefer if I could change the their titles respectively to:
> Total
> m1_large
> c1_medium
> m1_small
>
> Is this possible?
>
> Thanks,
> -Chris
>
> --
> You received this question notification because you are a member of
> graphite-dev, which is an answer contact for Graphite.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~graphite-dev
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~graphite-dev
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Brian Hatfield (bmhatfield) said :
#2

PS: There are some alternate alias functions on that page that may be
applicable if you wish to still use wildcards in your graph.

Brian

On Sun, May 13, 2012 at 10:35 PM, Brian Hatfield <email address hidden>wrote:

> Chris,
>
> You're looking for the "alias()" function.
>
>
> http://graphite.readthedocs.org/en/latest/functions.html#graphite.render.functions.alias
>
> Brian
>
>
>
>
> On Sun, May 13, 2012 at 10:30 PM, Chris Rutter <
> <email address hidden>> wrote:
>
>> New question #197125 on Graphite:
>> https://answers.launchpad.net/graphite/+question/197125
>>
>> Is it possible to change the title of the graph lines in the legend?
>>
>> For example:
>> https://img.skitch.com/20120514-cfyeaa46nqdykx1e9xtrb7b8hp.png
>> I used the following render call to generate the above graph:
>> render?from=-1d&target=stats.gauges.ops.instance_counts.st.us-east-1.*&width=650&height=300
>>
>> You can see my legend titles are quite lengthy due to the the fact they
>> are in a bucket that is a number of folders deep.
>> So rather then have:
>> stats.gauges.ops.instance_counts.st.us-east-1.Total
>> stats.gauges.ops.instance_counts.st.us-east-1.m1_large
>> stats.gauges.ops.instance_counts.st.us-east-1.c1_medium
>> stats.gauges.ops.instance_counts.st.us-east-1.m1_small
>>
>> I would prefer if I could change the their titles respectively to:
>> Total
>> m1_large
>> c1_medium
>> m1_small
>>
>> Is this possible?
>>
>> Thanks,
>> -Chris
>>
>> --
>> You received this question notification because you are a member of
>> graphite-dev, which is an answer contact for Graphite.
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~graphite-dev
>> Post to : <email address hidden>
>> Unsubscribe : https://launchpad.net/~graphite-dev
>> More help : https://help.launchpad.net/ListHelp
>>
>
>

Revision history for this message
Chris Rutter (chris-ruttermail) said :
#3

Thanks for the prompt reply Brian,

I had to upgrade from 0.9.9 to 0.9.10, but now everything is working great:
target=aliasByNode(stats.gauges.ops.instance_counts.st.us-east-1.*,6)

Much appreciated.