Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An experimental webhook for an experimental metrics library

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 config
Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Procfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 config.ru
README.md

Metriks log reporter webhook

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

Setup

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 = ActiveSupport::BufferedLogger.new(Rails.root.join('log/metriks.log').to_s)
  metriks_logger.level = Logger::INFO
  Metriks::Reporter::Logger.new(:logger => 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://github.com/eric/metriks_log_webhook.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:

http://holler-mountain-37.herokuapp.com/submit

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

License

Copyright (c) 2012 Eric Lindvall

Published under the MIT License, see LICENSE

Something went wrong with that request. Please try again.