Rails exception tracking with Graylog2 - RubyAndRails 2010 EU

3,064 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,064
On SlideShare
0
From Embeds
0
Number of Embeds
215
Actions
Shares
0
Downloads
21
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Rails exception tracking with Graylog2 - RubyAndRails 2010 EU

  1. 1. Rails exception tracking with Graylog2 Manage your logs in the dark and have lasers going and make it look like you're from space Lennart Koopmann RubyAndRails EU Amsterdam, 2010
  2. 2. About me Lennart Koopmann 22 years old Living in Hamburg, working at Jimdo lennartkoopmann.net / @_lennart
  3. 3. Log server with web interface.
  4. 4. phpLogCon … let's not talk about that Graylog1: August 2009 Graylog2: August 2010
  5. 6. Syslog daemon (TCP/UDP)
  6. 7. GELF (UDP)
  7. 8. Graylog extended log format UDP - Max (GZIP) 8192 byte per message (Chunking is supported) Libraries for Ruby and PHP available
  8. 9. { }
  9. 10. { ' message ':'Exception: Something went wrong.' }
  10. 11. { ' message ':'Exception: Something went wrong.', ' full_message ':'Stacktrace. Some env vars' }
  11. 12. { ' message ':'Exception: Something went wrong.', ' full_message ':'Stacktrace. Some env vars', ' host ':'www19' }
  12. 13. { ' message ':'Exception: Something went wrong.', ' full_message ':'Stacktrace. Some env vars', ' host ':'www19', ' file ':'/var/www/index.php' }
  13. 14. { ' message ':'Exception: Something went wrong.', ' full_message ':'Stacktrace. Some env vars', ' host ':'www19', ' file ':'/var/www/index.php', ' line ':2638 }
  14. 15. { ' message ':'Exception: Something went wrong.', ' full_message ':'Stacktrace. Some env vars', ' host ':'www19', ' file ':'/var/www/index.php', ' line ':2638, ' level ':1 }
  15. 16. { ' message ':'Exception: Something went wrong.', ' full_message ':'Stacktrace. Some env vars', ' host ':'www19', ' file ':'/var/www/index.php', ' line ':2638, ' level ':1, ' something ':'foo' }
  16. 17. { ' message ':'Exception: Something went wrong.', ' full_message ':'Stacktrace. Some env vars', ' host ':'www19', ' file ':'/var/www/index.php', ' line ':2638, ' level ':1, ' something ':'foo', ' something_else ':'bar' }
  17. 18. Chunking
  18. 19. Use Cases
  19. 20. Plain syslog Collect everything of your /var/log from all servers, aggregate, analyze and get a warning if something goes wrong
  20. 21. GELF Embed it into the logging class of your application and trigger with every error. Include stacktrace and env vars in full message. Later filter by file:line to get statistics.
  21. 22. Aggregate, analyze and get a warning if something goes wrong
  22. 23. Notifications Currently only Nagios hook (rake task) – Triggered at too many messages in last X minutes
  23. 24. Average page generation time Graylog1 / MySQL: ~12000ms
  24. 25. Average page generation time Graylog1 / MySQL: ~12000ms Graylog2 / MongoDB: ~250ms
  25. 26. Exception tracking with Rails Rack middleware available as gem
  26. 27. lennart ~$ sudo gem install graylog2_exceptions Successfully installed gelf-0.9.1 Successfully installed graylog2_exceptions-0.5.3
  27. 28. # config/environment.rb config.middleware.use " Graylog2Exceptions ", { :host => ' 127.0.0.1 ', :port => ' 12201 ', :local_app_name => ' mama ' }
  28. 29. Roadmap
  29. 30. Incident management Define chained rules that explain an incident. Trigger several actions when incident occurs.
  30. 31. Fine grained notifications Be informed via Email, XMPP, SMS by Graylog2 directly without Nagios hook
  31. 32. More analyzing
  32. 33. More search features
  33. 34. Live demo. www.graylog2.org / @Graylog2 www.lennartkoopmann.net / @_lennart (Slides are on Slideshare)

×