This Puppet module will install statsd on Debian or RedHat.
puppet module install --modulepath /path/to/puppet/modules jdowning-statsd
This module assumes nodejs & npm is installed on the host, but will not do it for you. I recommend using puppetlabs/nodejs to set this up.
class { 'statsd':
backends => [ './backends/graphite'],
graphiteHost => 'my.graphite.host',
flushInterval => 1000,
percentThreshold => [75, 90, 99],
}
You can install multiple backends. Supported backends include:
- graphite
- influxdb
- librato
- stackdriver
More information about the installation of each backend available in manifests/backends.pp.
class { 'statsd':
backends => ['./backends/graphite'],
graphiteHost => 'localhost'
}
class { 'statsd':
backends => ['statsd-influxdb-backend'],
influxdb_host => 'localhost'
}
class { 'statsd':
backends => ['statsd-librato-backend'],
librato_email => 'foo@bar.com',
librato_token => 'secret_token'
}
class { 'statsd':
backends => ['stackdriver-statsd-backend'],
stackdriver_apiKey => 'apiKey'
}
bundle install
bundle exec librarian-puppet install
vagrant up
Use the $environment
parameter to add custom environment variables or run scripts in the /etc/default/statsd
file. For example, you could enable Redhat's software collections and add a custom path like so:
class { 'statsd':
backends => ['./backends/graphite'],
graphiteHost => 'localhost',
environment => [
'source /opt/rh/nodejs010/enable',
'PATH=/opt/my/path:$PATH',
],
}