Building a Performance Analytics Tool with ActiveSupport
summary
Builds a tiny production-ready performance analytics pipeline called active monitoring that actually records response times and each SQL query using ActiveSupport instrumentation, writes metrics to InfluxDB time-series storage and graphs them on a dashboard (Grafana). Uses ~50 Rails hooks, implements a Rails plugin, a current_attributes request cache to join SQL events to requests, normalizes SQL with regexes before grouping, and relies on LSM-tree retention/downsampling. Notes measurable overhead from normalization and suggests moving it to C or async jobs if latency becomes significant.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 0:40Overview
- 2:56ActiveSupport
- 5:38Metrics
- 12:18Processing
- 16:02Visualization
- 19:45Summary
related talks
26mRails Performance Monitoring 101: A Primer for Developers
30mRails Performance monitoring: A primer for developers
45mRails Performance Monitoring 101: A Primer for Junior Developers
36mIt's not in Production Unless it's Monitored
01h 02mPerformance
17mActiveSupport::Notifications and Live Status Pages
54mOptimizing performance in Rails apps with GraphQL layer
30mBuilding RailsPerf, a toolkit to detect performance regressions
