0.05
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Checks that application's database, sidekiq etc are responding.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 0.8
~> 10.0
~> 3.0
~> 0.53
 Project Readme

HealthyRack

A simple Rack middleware/application for checking health state.

Disclaimer

This gem was made to fulfill personal needs and for fun. Hasn't been tested in production (yet?).

Installation

Add this line to your application's Gemfile:

gem 'healthy_rack'

Configuration

HealthyRack comes with several built in checks available:

HealthyRack::Checks::Redis
HealthyRack::Checks::ActiveRecord
HealthyRack::Checks::Sequel
HealthyRack::Checks::Sidekiq

By default all of them are disabled.

Also you can easily add custom check. Just provide a subclass of HealthyRack::Check or any object with similar interface.

Example configuration:

HealthyRack.configure do |config|
  config.add_checks(
    HealthyRack::Checks::ActiveRecord.new,
    HealthyRack::Checks::Redis.new('redis://redis:7379/0')
  )
end

Usage as middleware

Just add HealthyRack.middleware to middleware stack of your rack application:

use HealthyRack.middleware, path: '/health'

where /health is desired path.

Mounting as rack application

MountHealthyRack.app at your router:

Rack::URLMap.new('/health' => HealthyRack.app)

Similar projects

You may be interested in other projects such as:

Thanks for their authors for the inspiration :)