Creating a template

Asked by Micah Whitacre

In the CLI documentation[1], it mentions applying templates to graphs. However I have yet to find documentation on how to actually create a template. Can someone point to documentation on how to do it or give instructions on doing so?

[1] - http://graphite.wikidot.com/cli-reference

Question information

Language:
English Edit question
Status:
Answered
For:
Graphite Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Nicholas Leskiw (nleskiw) said :
#1

edit /opt/graphite/webapp/graphite/render/graphTemplates.conf

There should be some examples in there.

Here's the code that loads the template, so if you don't see the option
you're trying to set in this block, it won't get set...

 335 def loadTemplate(self,template):
 336 conf = SafeConfigParser()
 337 if conf.read(settings.GRAPHTEMPLATES_CONF):
 338 defaults = dict( conf.items('default') )
 339 if template in conf.sections():
 340 opts = dict( conf.items(template) )
 341 else:
 342 opts = defaults
 343 else:
 344 opts = defaults = defaultGraphOptions
 345
 346 self.defaultBackground = opts.get('background',
defaults['background'])
 347 self.defaultForeground = opts.get('foreground',
defaults['foreground'])
 348 self.defaultMajorGridLineColor = opts.get('majorline',
defaults['majorline'])
 349 self.defaultMinorGridLineColor = opts.get('minorline',
defaults['minorline'])
 350 self.defaultColorList = [c.strip() for c in opts.get('linecolors',
defaults['linecolors']).split(',')]
 351 fontName = opts.get('fontname', defaults['fontname'])
 352 fontSize = float( opts.get('fontsize', defaults['fontsize']) )
 353 fontBold = opts.get('fontbold', defaults['fontbold']).lower() ==
'true'
 354 fontItalic = opts.get('fontitalic', defaults['fontitalic']).lower()
== 'true'
 355 self.defaultFontParams = {
 356 'name' : self.params.get('fontName',fontName),
 357 'size' : int( self.params.get('fontSize',fontSize) ),
 358 'bold' : self.params.get('fontBold',fontBold),
 359 'italic' : self.params.get('fontItalic',fontItalic),
 360 }

On Thu, Aug 4, 2011 at 10:51 AM, Micah Whitacre <
<email address hidden>> wrote:

> New question #166950 on Graphite:
> https://answers.launchpad.net/graphite/+question/166950
>
> In the CLI documentation[1], it mentions applying templates to graphs.
> However I have yet to find documentation on how to actually create a
> template. Can someone point to documentation on how to do it or give
> instructions on doing so?
>
> [1] - http://graphite.wikidot.com/cli-reference
>
> --
> 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
Steve Kieu (msh-computing) said :
#2

There is no such file in the recent version of grpahite

Revision history for this message
Michael Leinartas (mleinartas) said :
#3

0.9.9 includes a graphTemplates.conf.example in the webapp conf directory (default /opt/graphite/conf). You can also see it here: http://bazaar.launchpad.net/~graphite-dev/graphite/main/view/589/conf/graphTemplates.conf.example

This is placed in the webapp conf directory and named 'graphTemplates.conf'.

Can you help with this problem?

Provide an answer of your own, or ask Micah Whitacre for more information if necessary.

To post a message you must log in.