Skip to content
Newer
Older
100644 72 lines (41 sloc) 1.97 KB
48e4dbe @eric Initial commit
authored Feb 10, 2012
1 # Metriks log reporter webhook
2
723d2ad @eric Update the README
authored Feb 11, 2012
3 Webhook receiver for taking logs from [metriks](https://github.com/eric/metriks/)
4 and sending them to [Librato Metrics](https://metrics.librato.com) via
5 a [Papertrail](https://papertrailapp.com/) webhook.
48e4dbe @eric Initial commit
authored Feb 10, 2012
6
723d2ad @eric Update the README
authored Feb 11, 2012
7
8 # Setup
9
10 ## Step 1: Integrate metriks into your project
11
12 To get anything useful out of this, you have to already be using
13 [metriks](https://github.com/eric/metriks/).
14
15
16 ## Step 2: Setup the metriks logger reporter
17
18 Once you've done that, setup a logger reporter. For example:
19
20 ``` ruby
21 # Setup metriks logger
22 require 'metriks/reporter/logger'
23
24 metriks_logger = ActiveSupport::BufferedLogger.new(Rails.root.join('log/metriks.log').to_s)
25 metriks_logger.level = Logger::INFO
26 Metriks::Reporter::Logger.new(:logger => metriks_logger).start
27 ```
28
29 ## Step 3: Send the logs to Papertrail
30
31 Once you've done that, send the log to [Papertrail](https://papertrailapp.com/).
32 The easiest way would be to use [remote_syslog](https://github.com/papertrail/remote_syslog/):
33
34 $ remote_syslog -p <your_papertrail_port> /srv/www/app/shared/log/metriks.log
35
36
37 ## Step 4: Create an instance of this webhook on heroku
38
39 The easiest way to run this is to grab the code and run a copy on heroku:
40
9ec3dfd @eric README fixes
authored Feb 11, 2012
41 $ git clone git://github.com/eric/metriks_log_webhook.git
723d2ad @eric Update the README
authored Feb 11, 2012
42 $ cd metriks_log_webhook
43 $ heroku create --stack cedar
44 $ heroku addons:add memcache
45 $ git push heroku master
46 $ heroku config:add METRICS_EMAIL=<librato_metrics_email> METRICS_TOKEN=<librato_metrics_token>
47
48 ## Step 5: Create a saved search in Papertrail
49
50 Then create a saved search in Papertrail for:
51
52 "metriks: "
53
54
55 ## Step 6: Create a search alert and point it to the webhook
56
57 Create a Search Alert in Papertrail to fire every minute pointed at `/submit`.
58
59 For instance:
60
61 http://holler-mountain-37.herokuapp.com/submit
62
63 Once you've done that, you should start to see metrics in your Librato Metrics
64 dashboard.
4dbce12 @eric Reworking some code
authored Feb 10, 2012
65
48e4dbe @eric Initial commit
authored Feb 10, 2012
66
67 # License
68
69 Copyright (c) 2012 Eric Lindvall
70
71 Published under the MIT License, see LICENSE
Something went wrong with that request. Please try again.