An experimental webhook for an experimental metrics library
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Metriks log reporter webhook

Webhook receiver for taking logs from metriks and sending them to Librato Metrics via a Papertrail webhook.


Step 1: Integrate metriks into your project

To get anything useful out of this, you have to already be using metriks.

Step 2: Setup the metriks logger reporter

Once you've done that, setup a logger reporter. For example:

  # Setup metriks logger
  require 'metriks/reporter/logger'

  metriks_logger ='log/metriks.log').to_s)
  metriks_logger.level = Logger::INFO => metriks_logger).start

Step 3: Send the logs to Papertrail

Once you've done that, send the log to Papertrail. The easiest way would be to use remote_syslog:

$ remote_syslog -p <your_papertrail_port> /srv/www/app/shared/log/metriks.log

Step 4: Create an instance of this webhook on heroku

The easiest way to run this is to grab the code and run a copy on heroku:

$ git clone git://
$ cd metriks_log_webhook
$ heroku create --stack cedar
$ heroku addons:add memcache
$ git push heroku master
$ heroku config:add METRICS_EMAIL=<librato_metrics_email> METRICS_TOKEN=<librato_metrics_token>

Step 5: Create a saved search in Papertrail

Then create a saved search in Papertrail for:

"metriks: "

Step 6: Create a search alert and point it to the webhook

Create a Search Alert in Papertrail to fire every minute pointed at /submit.

For instance:

Once you've done that, you should start to see metrics in your Librato Metrics dashboard.


Copyright (c) 2012 Eric Lindvall

Published under the MIT License, see LICENSE