Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Configuration

nextmat edited this page Sep 20, 2012 · 24 revisions

Configuration options

There are two primary ways to configure librato-rails. You can either use a yaml-based config file, environment variables, or a combination of the two.

Use of the config file allows you to set up different configuration options by environment. Environment variables will be used by all environments when present.

Config file

To use a config file, create a file named librato.yml in the config directory of your rails project. Here's a sample config file:

production:
  user: '[email protected]'
  token: 'api key'

staging:
  user: '[email protected]'
  token: 'api key'
  source: 'staging-1'

The following options can be set per environment in config files:

  • user - the email address of your Librato Metrics account
  • token - the api key of your Librato Metrics account
  • flush_interval - how often aggregated metrics will be sent, in seconds (default: 60)
  • source - the source metrics will be reported from (default: machine hostname). If you are overriding this you likely want to set it to a different value per host or host group.
  • prefix - an optional prefix which will be attached to all metric names reported by librato-rails. For example, if the prefix is set to foo, rails.request.total will be reported as foo.rails.request.total.

Environment variables

  • LIBRATO_METRICS_USER - the email address of your Librato Metrics account
  • LIBRATO_METRICS_TOKEN - the api key of your Librato Metrics account
  • LIBRATO_METRICS_SOURCE - the default source metrics will be reported from

Note that environment variables will dominate when a value is also present in a librato.yml config file.

Heroku users: If you are using the Librato Heroku Add-on, the LIBRATO_METRICS_USER and LIBRATO_METRICS_TOKEN will be automatically set already in your environment.

Clone this wiki locally