basecamp / easymon

Easy Monitoring
MIT License
205 stars 16 forks source link

Make health check autodetectable. #34

Open rubys opened 1 year ago

rubys commented 1 year ago

Background: Rails 7.1 will be adding health checks. I work for Fly.io as a Rails Speciality and would like to make Fly.io automatically detect the presence of health checks and pre-configure applications to enable these health checks if I can detect them. The problem is that health checks can vary on paths and implementation. I have a pull request that has been merged into Rails 7.1, and a pull request open for the rails_healthcheck gem that enable me to discover the healthcheck endoint using the following code:

bin/rails runner "p Rails.application.routes.url_helpers.rails_health_check_path"

Easymon poses unique challenges. For starters, there can be multiple endpoints, and it would be desirable to provide a way to indicate which one is the default one. Easymon is also implemented as an engine, so the url helper is scoped to the engine.

Rather than making assumptions, I'm opening up an issue so we can discuss how to approach this problem. If there is code I can contribute, I'm willing to do the work. If there is a recommendation on how I can adjust my check, let me know.

See also:

rubys commented 1 year ago

More background on this request: https://fly.io/ruby-dispatch/health-checks/