Giter Site home page Giter Site logo

shlima / health_bit Goto Github PK

View Code? Open in Web Editor NEW
111.0 2.0 8.0 178 KB

Tiny health check of Rack apps like Rails, Sinatra for use with uptime checking systems like Kubernetes, Docker or Uptimerobot

License: MIT License

Ruby 98.73% Shell 1.27%
ruby ruby-on-rails rack health health-check healthcheck

health_bit's People

Contributors

dependabot[bot] avatar houhoulis avatar ndbroadbent avatar nikolai-b avatar shlima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

health_bit's Issues

Cloning HealthBit does not clone configuration

HealthBit version: 0.1.8

When doing the following:

HealthBit.configure do |c|
  c.success_text = 'Custom message.'
end

CheckA = HealthBit.clone
Check B = HealthBit.clone

The configure block is ignored. To get it to work you must instead do:

CheckA = HealthBit.clone
Check B = HealthBit.clone

CheckA.configure do |c|
  c.success_text = 'Custom message.'
end

CheckB.configure do |c|
  c.success_text = 'Custom message.'
end

I'd expect the former to clone the configuration from HealthBit so you can DRY up common configuration.

I suggest CI travis tests

Your project looks interesting, and I hope it grows to the point I can retire health_check from active development - the legacy baggage has grown.

I suggest a CI auto test that builds a rails app, includes this gem and then checks everything works.

I have added a comment " HealthBit - inspired by this gem but with a fresh start as a simpler rack only application, no travis CI tests (yet?) but looks interesting" to my health_check gem README to cross link.

Feature Request: Report all failures

HealthBit version: 0.1.8

Currently only the first failed check is returned. It would be nice to have an option to continue beyond the first failed check and report all failures.

How can I skip the Rails 6 "hosts" check for the /health endpoints?

Hello, thanks for releasing this gem!

Rails 6 added a config.hosts setting that you can use to set up a whitelist of allowed hosts. This is useful, and I would like to keep it enabled.

However, I use HealthBit to set up a /health endpoint, and I use this for monitoring, and during deploys. It's important that my app will always respond on this endpoint during deploys, even if the host is missing or isn't one of the white-listed hosts.

Do you know how I could skip the hosts check for these endpoints? Maybe this can be done if I mount the HealthBit app as a Rack middleware very early in the stack, but I'm not sure how to do that.

Feature Request: Parallel checks

HealthBit version: 0.1.8

Currently the checks are completed in series. Almost by definition (although not necessarily), checks verify independent systems, so it may be nice to have the option of executing the tests in parallel to get a faster total response time.

Feature Request: JSON Responses + Failure messages

It would be great to be able to configure response formats and customize

Currently, I'm able to do this for successful responses like so:

HealthBit.configure do |config|
  config.headers = {
    'Content-Type'  => 'application/json;charset=utf-8',
    'Cache-Control' => 'private,max-age=0,must-revalidate,no-store'
  }

  config.success_text = { status: 'ok' }.to_json
end

But this feels like a bit of a hack and there appears to be no way to configure the failure text.

Explicitly returning a result in a check always fails

HealthBit Version: 0.1.8

When using an explicit return the check always fails:

For example, the following check always fails:

LiveCheck.add('MyCheck') do
  return true
end

Whereas the following works as expected:

LiveCheck.add('MyCheck') do
  true
end

This is particularly problematic when you want to use a guard clause to return early:

LiveCheck.add('MyCheck') do
  return true if # some condition

  # ... else do something other check
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.