librato/metrics-rails — pull request #5 by freelancing-god (2012-08-25 16:00:27+00:00)
Title: Rack Middleware for non-Rails statistics

A lot of the requests coming in on my site are API requests that are handled by embedded Rack apps. I wasn't getting any stats for them, because the requests weren't hitting controllers. So, I've added a Rack middleware. This does double-up some statistics (timing, mainly), but the event labels are different. I've also moved the Heroku header stats into the middleware, which removes the need for one of the before_filters.

Feedback welcome - I've just put this into production (on Heroku) and it's working fine from what I can see.