~/talk

Digging Deep with ActiveSupport::Notifications

Talkat RailsConf 2012 · 2012-04-23..04-25· [ruby-on-rails, observability]
links:none on file
slides:none on file

ActiveSupport::Notifications (Rails 3+) provides evented instrumentation: you fire instruments and register subscribers that receive name, start/end, id and a payload hash; block form yields automatic duration and exception name/message. Rails already emits process_action.action_controller (controller, action, format, status, view/db timing) and SQL.active_record (every query, SQL, duration, name), so you can log to Papertrail, send metrics to StatsD or New Relic, stash explain plans for slow queries, toggle per-customer collection with rollout, and beware subscribers run synchronously unless you replace the dispatcher.

AI-written summary · about

  1. 0:00Introduction
  2. 1:09What are ActiveSupport::Notifications
  3. 3:17Why it matters
  4. 5:02Subscribers and instrumentation
  5. 8:36Rails events to use now
  6. 10:19Controller events examples
  7. 12:51Tracking ActiveRecord queries
  8. 14:56Turning insights into action
  9. 15:38Sending data to monitoring
  10. 18:25Performance considerations
  11. 21:35Conditional instrumentation with Rollout
  12. 23:21Notifications with Campfire
  13. 24:24Simpler instrumentation syntax
  14. 25:07LogSubscriber for cleaner code
  15. 26:51Using outside Rails
  16. 27:55Gems using this pattern
  17. 29:40Projects using notifications
  18. 31:48Best practices
  19. 33:10Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.