An open API service indexing awesome lists of open source software.

https://github.com/remind101/heroku-kit

An opinionated collection of middleware for Ruby apps running on Heroku.
https://github.com/remind101/heroku-kit

Last synced: about 1 year ago
JSON representation

An opinionated collection of middleware for Ruby apps running on Heroku.

Awesome Lists containing this project

README

          

# Heroku Kit

An opinionated collection of middleware, utilities and best practives for
[12factor](http://12factor.net) Ruby apps running on Heroku.

* [rack-timeout](https://github.com/kch/rack-timeout) for timing out long
running requests.
* [formatted-metrics](https://github.com/remind101/formatted-metrics) for logging metrics to STDOUT
for consumption by [l2met](https://github.com/ryandotsmith/l2met).
* [collective](https://github.com/remind101/collective) for collecting metrics from services.
* [request\_id](https://github.com/remind101/request_id) for tracing request\_id's through systems.
* [rails\_12factor](https://github.com/remind101/rails_12factor) for enabling
STDOUT logging and static asset serving in production.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'heroku-kit', github: 'remind101/heroku-kit'
```

## Usage

First, ensure that you have the http-request-id and log-runtime-metrics labs
features enabled:

```bash
heroku labs:enable http-request-id
heroku labs:enable log-runtime-metrics
```

### Rails

You're done!

### Rack

Add the middlewares:

```ruby
use Rack::Timeout
use Rack::RequestId
use Rack::Instrumentation
```

Configure your logger:

```ruby
App.logger = Heroku::Kit::Logger.new
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request