shlima / health_bit Goto Github PK
View Code? Open in Web Editor NEWTiny health check of Rack apps like Rails, Sinatra for use with uptime checking systems like Kubernetes, Docker or Uptimerobot
License: MIT License
Tiny health check of Rack apps like Rails, Sinatra for use with uptime checking systems like Kubernetes, Docker or Uptimerobot
License: MIT License
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.
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
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.
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.
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.