-
Notifications
You must be signed in to change notification settings - Fork 43
Graph Fields
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
## 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.
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)"
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()
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()
With derivative data, scale the data automatically to the desired rate in seconds. For example, put 60 to display the rate per minute.
field :foo, :data => "fqdn.disk.reads",
:derivative => true,
:scale_to_seconds => 1
Corresponds to the graphite function scaleToSeconds()
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()
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()
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()
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()
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()
Disables automatic aliasing of targets
Renders a data item in the same style as Cacti using current, min and max legends.
field :io_wait, :data => "fqdn.cpu.iowait",
:scale => 0.001,
:alias => "IO Wait",
:cacti_style => true
Draws the top n servers with the highest average value.
field :io_wait, :data => "*.cpu.iowait",
:scale => 0.001,
:alias => "IO Wait",
:highest_average => 5
Alias values based on a sub part of the data item names. For a negative index value, the number of the sub parts is added to the index.
field :io_wait, :data => "*.cpu.iowait",
:scale => 0.001,
:alias_by_node => 0
This will create graphs with items aliased by the first part of each data item
Run series names through a regex search/replace.
field :io_wait, :data => "*.disk.*.reads"
:alias_sub_search => '.*(\w+)\.reads',
:alias_sub_replace => 'disk \1'
Corresponds to the graphite function aliasSub()
Appends a value to the metric, one of last, avg, total, min or max. Mutually exclusive to the above cacti_style option
field :io_wait, :data => "*.cpu.iowait",
:scale => 0.001,
:legend_value => "avg"