ankane/blazer-docker

Health endpoint not working in 3.1.0

Closed this issue · 3 comments

The /health endpoint is returning 503 with Blazer 3.1.0.

After a manual connect! it would work.

CleanShot 2024-10-16 at 10 20 23@2x

    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 :)

Hi @otherguy, thanks for reporting. Removed the database check in the commit above and pushed a new image to the latest tag.

# checks app is up, not database or data sources healthy

Actually a much better check and in-line with Kubernetes recommendations :chefskiss:

@ankane could you please also push a new tag, eg. 3.1.1 (or overwrite 3.1.0)? We're only updating to release tags, not latest.