0.0
Low commit activity in last 3 years
A long-lived project that still receives updates
A gem to view status checks of multiple services from a single page.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 7, >= 3.2
 Project Readme

MonitorPage

A gem to view status checks of multiple services from a single page.

Usage

Create an initializer and setup your checks. Each check should have a pass and an error call.

MonitorPage.configure do
  # Whitelist IPs that have access to the status page. Can be a single IP or of CIDR notation.
  # Optional: if left out it will be publically available
  permit '1.1.1.1', '1.1.2.0/24'

  check 'Sidekiq' do
    if Sidekiq::Queue.all.select{ |q| q.size > 50 }.any?
      error "Sidekiq has too many jobs"
    else
      pass
    end
  end

  check 'Passing Check' do
    pass
  end

  check 'Failing Check' do
    error "GAME OVER MAN, GAME OVER!"
  end
end

In your routes:

  mount MonitorPage::Engine, at: '/monitor_page'

Visiting /monitor_page should give you something like this:

Sidekiq: Passed
Passing Check: Passed
Failing Check: Failed - GAME OVER MAN, GAME OVER!
-----------
Overall: Failed

Overall will always display Passed or Failed based on if all the above checks have passed or if there is a failure.

Installation

Add this line to your application's Gemfile:

gem 'monitor_page'

And then execute:

$ bundle

Or install it yourself as:

$ gem install monitor_page

License

The gem is available as open source under the terms of the MIT License.