An opinionated collection of middleware, utilities and best practives for 12factor Ruby apps running on Heroku.
- rack-timeout for timing out long running requests.
- formatted-metrics for logging metrics to STDOUT for consumption by l2met.
- collective for collecting metrics from services.
- request_id for tracing request_id's through systems.
- rails_12factor for enabling STDOUT logging and static asset serving in production.
Add this line to your application's Gemfile:
gem 'heroku-kit', github: 'remind101/heroku-kit'
First, ensure that you have the http-request-id and log-runtime-metrics labs features enabled:
heroku labs:enable http-request-id
heroku labs:enable log-runtime-metrics
You're done!
Add the middlewares:
use Rack::Timeout
use Rack::RequestId
use Rack::Instrumentation
Configure your logger:
App.logger = Heroku::Kit::Logger.new
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request