eric edited this page Mar 6, 2012 · 2 revisions


Reporters take a Registry and report the metrics to a remote store.

Most reporters take an options hash that can override default behavior:

  • :registry: What registry to report on. Defaults to Metriks::Registry.default
  • :interval: What interval to report on. Defaults to 60 seconds
  • :on_error: A Proc to call when an exception is encountered


Sends metrics to graphite on a set interval.

Takes two arguments:

  • host: hostname of system running the carbon agent
  • port: port that the carbon agent is listening on

Extra arguments in options hash:

  • :prefix: prefix to prepend to all metric keys

Example usage:

reporter ='localhost', 3309)


Send metrics to Librato Metrics on a specified interval.

Takes two arguments:

  • email: email address to authenticate against
  • token: API token associated with the email address

Extra arguments in options hash:

  • :prefix: prefix to prepend to all metric keys
  • :source: source to send with all reported metrics

Example usage:

reporter ='user@metriks.local', '186dbe1cf215')


Sends metrics to a logger on a specified interval.

Extra arguments in options hash:

  • :logger: logger to send metrics to. Defaults to
  • :log_level: log level to send to. Defaults to ::Logger::INFO
  • :prefix: prefix to prepend to all log lines. Defaults to metriks:

Example usage:

logger ='log/metrics.log')
reporter = => logger)


Being inspired by rack-statsd I realized there are many metrics that are deep in my processes that would be very interesting to keep track of how my workers are running.

This reporter isn't really like the others. It reports metrics by updating your proctitle so you can see select metrics when you run ps aux.

Because space in the process title is limited, it requires configuration to specify what metrics are reported.

Extra arguments in options hash for the initializer:

  • :prefix: prefix to prepend to the process name. Defaults to $0
  • :rounding: number of decimal places the values are rounded to. Defaults to 1

Example usage:

reporter =
reporter.add 'reqs', 'sec' do

It would allow you to see the metric when you run ps aux:

501      17015 26.0  1.9 416976 246956 ?       Ss   18:54  11:43 thin reqs: 273.3/sec
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.