Health endpoint not working in 3.1.0
Closed this issue · 3 comments
otherguy commented
The /health
endpoint is returning 503
with Blazer 3.1.0.
After a manual connect!
it would work.
routes.append do
# checks app is up and can connect to database
# does not check data sources
# not protected by auth, so do not expose data
get "health", to: ->(env) {
if Blazer::Connection.connection.active?
[200, {}, ["OK"]]
else
[503, {}, ["Service Unavailable"]]
end
}
mount Blazer::Engine, at: "/"
You probably should also add the ostruct
gem to your Gemfile to get rid of the deprecation warning and set RAILS_ENV
to default to production
in the Docker container :)
ankane commented
Hi @otherguy, thanks for reporting. Removed the database check in the commit above and pushed a new image to the latest
tag.
otherguy commented
# checks app is up, not database or data sources healthy
Actually a much better check and in-line with Kubernetes recommendations :chefskiss: