Slide 1

Slide 1 text

Log analysis for your Heroku app

Slide 2

Slide 2 text

Eric Lindvall @lindvall github.com/eric

Slide 3

Slide 3 text

Papertrail

Slide 4

Slide 4 text

Watch your application from a browser

Slide 5

Slide 5 text

Search for problems

Slide 6

Slide 6 text

Jump to when something happened

Slide 7

Slide 7 text

See all of your apps in one place

Slide 8

Slide 8 text

Create alerts to act on your searches Have them run every minute, hour or day

Slide 9

Slide 9 text

Send important messages to Campfire

Slide 10

Slide 10 text

Send nightly reports in email

Slide 11

Slide 11 text

Notify PagerDuty when something is wrong

Slide 12

Slide 12 text

Graph message counts in Librato Metrics

Slide 13

Slide 13 text

Papertrail alert webhooks are open source https://github.com/papertrail/papertrail-services

Slide 14

Slide 14 text

Run your own webhook on Heroku

Slide 15

Slide 15 text

Automatically scale dynos based on queue time IDEA

Slide 16

Slide 16 text

Alert your iPhone when too many errors occur IDEA

Slide 17

Slide 17 text

Use a webhook to collect app metrics from Metriks EXAM PLE https://github.com/eric/metriks https://github.com/eric/metriks_log_webhook

Slide 18

Slide 18 text

Metriks.timer('fib.time').time do fib(15) end Turn Measurements into logs Apr 17 06:09:01 app app/web.1: metriks: time=1334668140 name=fib.time type=timer count=23348919 one_minute_rate=76.0977078982827 five_minute_rate=68.1730503588775 fifteen_minute_rate=62.5690560606605 mean_rate=39.3749046450413 min=0.0100461 max=121.660915185 mean=0.0643679864834903 stddev=0.051298728482402 median=0.018409955 95th_percentile=0.1440550285 Apr 17 06:09:01 app app/web.2: metriks: time=1334668140 name=fib.time type=timer count=13894859 one_minute_rate=23.9993183538984 five_minute_rate=31.6901486523292 fifteen_minute_rate=35.0794473490055 mean_rate=23.4224094363587 min=0.00994003 max=123.195304423 mean=0.0397875258344949 stddev=0.0213955001420874 median=0.015471635 95th_percentile=0.0905222869999997

Slide 19

Slide 19 text

Turn Logs into graphs Apr 17 06:09:01 app app/web.1: metriks: time=1334668140 name=fib.time type=timer count=23348919 one_minute_rate=76.0977078982827 five_minute_rate=68.1730503588775 fifteen_minute_rate=62.5690560606605 mean_rate=39.3749046450413 min=0.0100461 max=121.660915185 mean=0.0643679864834903 stddev=0.051298728482402 median=0.018409955 95th_percentile=0.1440550285 Apr 17 06:09:01 app app/web.2: metriks: time=1334668140 name=fib.time type=timer count=13894859 one_minute_rate=23.9993183538984 five_minute_rate=31.6901486523292 fifteen_minute_rate=35.0794473490055 mean_rate=23.4224094363587 min=0.00994003 max=123.195304423 mean=0.0397875258344949 stddev=0.0213955001420874 median=0.015471635 95th_percentile=0.0905222869999997

Slide 20

Slide 20 text

Heroku metriks_log_webhook (sinatra app) Rails app (with metriks gem) Papertrail Librato Metrics Papertrail webhook logs to Papertrail How it all fits together

Slide 21

Slide 21 text

Questions?

Slide 22

Slide 22 text

All of the links Get a free account: https://papertrailapp.com/ Talk to us: https://papertrailapp.com/chat Send logs from your heroku app: https://papertrailapp.com/help/heroku Ask us questions: https://help.papertrailapp.com/ Webhook documentation: http://help.papertrailapp.com/kb/how-it-works/web-hooks Read the papertrail-services source: https://github.com/papertrail/papertrail-services/ See an example custom webhook: https://github.com/eric/metriks_log_webhook/ Download this presentation: http://speakerdeck.com/u/lindvall/p/log-analysis-for-your-heroku-app

Slide 23

Slide 23 text

Thanks!