Graphite: multiple series with a single command

Nova picture Nova · Oct 10, 2012 · Viewed 18.7k times · Source

I would like to put two series in the same graph on the graphite dashboard. However, since the dashboard requires single-line commands I could not find a way that doesn't involve the use of a wildcard.

Here's an example of the two series I would like in the same graph:

sum(base.foo.bar.positive.*)
sum(base.foo.bar.negative.*)

I tried several separators but I could not get it to work. Any ideas?

Answer

dannyla picture dannyla · Oct 11, 2012

You have a few options here...

  • Merge the 2 graphs on to the graph via the drag and drop in the dashboard

OR

Merge 2 or more wildcard matching

  1. Open your first graph on the dashboard
  2. Open your second graph on the same dashboard
  3. Click and hold the second graph and drag it over the first graph

Use groupByNode() and wildcard matching

This is not as nice, and will not always work however you will be able to do this all in one line.

sumSeriesWithWildcards(base.foo.bar.{positive,negative}.*, 3)

This will do the following:

  • Select all all the graphs that match base.foo.bar.positive.* and base.foo.bar.negative.*
  • Sum the data by the node at position 3: positive, negative

You might want to have a read over the following page: http://graphite.readthedocs.org/en/1.0/functions.html