Skip to content
ripienaar edited this page Oct 16, 2011 · 1 revision

Each item shown on a graph is known as a field, fields have a lot of possible properties.

First we'll start with a few common examples and later have a reference of all the properties

title "Test Graph"

field :iowait, :data => "sumSeries(example.munin.load.load)",
               :color => "red",
               :alias => "Load Average",
               :derivative => true

basic-field.png

## Field Properties The following properties can be applied to any single field and applies to that field only. Fields appear in the graph in the order they are in the file.

The first argument - :iowait above - is the field name and should be unique for this graph.

data

The main data for the field, this can be anything graphite will accept as a target. There are a number of properties that you can apply to this data so you can generally keep this pretty simple even for derived data etc.

field :foo, :data => "fqdn.load.load"

field :load, :data => "sumSeries(*.load.load)"

derivative

The data is of an ever increasing type, you can derive the rate of change using this property.

field :foo, :data => "fqdn.cpu.iowait",
            :derivative => true

Corresponds to the graphite function derivative()

scale

Some data are in milliseconds and you might want it in seconds, this let you scale the data by some fraction.

field :foo, :data => "fqdn.cpu.iowait",
            :scale => 0.001

Corresponds to the graphite function scale()

line

Sometimes you have infrequent data like git commits. This allow you to draw any non zero value as a vertical line.

field :foo, :data => "site.deploy",
            :line => true

Corresponds to the graphite function drawAsInfinite()

color

Sets the line color either to one of graphites well known types or a hex value

field :foo, :data => "site.deploy",
            :line => true,
            :color => "red"

Corresponds to the graphite function color()

dashed

Causes a line to be drawn as a dashed line rather than solid

field :foo, :data => "site.deploy",
            :line => true,
            :dashed => true

Corresponds to the graphite function dashed()

second_y_axis

Since graphite 0.9.9 you can draw data using both y axis, this allows you to set a specific field on the 2nd y axis

field :foo, :data => "fqdn.cpu.iowait",
            :scale => 0.001,
            :second_y_axis => true

Corresponds to the graphite function secondYAxis()

alias

You can set a custom legend caption for this field. By default this will be the graph name capitalized but you can adjust that easily.

field :io_wait, :data => "fqdn.cpu.iowait",
            :scale => 0.001,
            :alias => "IO Wait"

Without the alias property the graph caption would have been Io_wait.

Corresponds to the graphite function alias()