activesupport::notifications inside out
TRANSCRIPT
Context
★ Runtime data collection management★ Introduce Rails instrumentation★ Instrumentation in practice★ AS::Notification implementation★ Maximise instrumentation power
Problems
★ Logging, profiling modules etc tightly coupled with functional modules
★ Modules mixed together (SRP violation)★ Different types of runtime data require
different handlers
Instrumentation to rescue
★ Data logging★ Event tracking★ Performance tracking★ Debugging and exception handling★ Profiling
Introduce Rails instrumentation
★ Provide and used by Rails★ Hook with Rails events or BYO★ Pub/ Sub pattern★ Highly customisable modules★ Thread safe
Maximise instrumentation power
★ Logging★ New Relic★ Email notification★ Event tracking - SiteCatalyst★ Stats collection - statsD★ Trigger Background jobs★ Web hooks to trigger other web services
Maximise instrumentation power
★ Independent from Rails, plug in to any Ruby projects
★ Good Abstraction○ replace notifier (Fanout) with your own queue○ pass in your own listeners to customise start/
publish/ finish hooks, instead of plain blocks★ Send slow subscriber works to background
jobs or message queues