Add the following to your manifest:
class {'ss_graphite_client':
graphite_server => 'metrics.my.com',
}
By default, graphite-functions library will try to figure out a prefix that makes some sense. However it's rather likely you will need to customise it. In that case, write the custom prefix to /opt/graphite/prefix
and it will be automatically picked up.
Metrics are grouped in classes. You enable them by including the relevant class:
include ss_graphite_client::core
We recommend the following approach when defining new metrics.
First, copy one of the following templates as your base:
These show you how to include the graphite-functions library. This library allows you to easily send metrics to graphite using the functions they expose (such as send
or sendHash
). By convention, the metric key is built by applying the prefix (also exposed from the library).
The metrics are enabled by simply adding them to /opt/graphite/scripts
or /opt/graphite/scripts-daily
. Bundle the file resources in a metric class, for example:
class my_metrics::filesystem {
file {'/opt/graphite/scripts/inodes':
owner => root,
group => root,
mode => 755,
source => 'puppet:///modules/my_metrics/graphite-scripts/inodes',
}
# ... could contain more metrics
}
Once this is done, the metric can be added thus:
include my_metrics::filesystem