Rails answers that with the built-in /up endpoint.
But production systems need to answer a much more important question:
A process can remain alive even when the application itself is degraded or completely unavailable.
Note that this is somewhat by design. Health check endpoints have different meaning / usage.
If the goal is a general health metric to get paged with something like pingdom, then checking whether the database is reachable make sense.
But healthecks are also commonly used by load balancers to get nodes out of rotations, and in that case you absolutely don't want to check anything other than the Ruby process itself, because otherwise if your database or Redis is unavailable for a few seconds, it can cause the load balancer to eject all your web-servers, and in some systems like kubernetes, that can even result in pods being restarted, turning a few seconds DB blip into a full on outage.
Thank you. That is a fair point. I am going to update the gem and document this scenario over the next few days. I have added the initial plan to the gems repo ROADMAP. Again, thank you for the feedback.
I have just released v1.1.0, which includes support for Rails 7.1/7.2.
Please note Rails EOL, currently 7.2 security support ends Aug 2026, and 7.1 ended in Oct 2025. This is why I decided not to support 7.0 and further back.
Very cool. Just wondering though: does this really has any hard dependency on Rails? Looks like it could be useful out of a Rails environment too (as a simple Rack app)
That is an interesting idea. This is built as a Rails Engine, so I will have to look into it. Feel free to open an issue on the repo and I will look into it.
10
u/f9ae8221b Jun 11 '26
Note that this is somewhat by design. Health check endpoints have different meaning / usage.
If the goal is a general health metric to get paged with something like pingdom, then checking whether the database is reachable make sense.
But healthecks are also commonly used by load balancers to get nodes out of rotations, and in that case you absolutely don't want to check anything other than the Ruby process itself, because otherwise if your database or Redis is unavailable for a few seconds, it can cause the load balancer to eject all your web-servers, and in some systems like kubernetes, that can even result in pods being restarted, turning a few seconds DB blip into a full on outage.
2
u/Forge2017 Jun 11 '26
Nice. But couldnt it had supported Rails 7?
1
u/bawsky123 Jun 11 '26
Very cool. Just wondering though: does this really has any hard dependency on Rails? Looks like it could be useful out of a Rails environment too (as a simple Rack app)
3
u/jrochkind Jun 11 '26
Nicely designed, thank you! Prometheus is just the cherry on top!
1
u/welguisz Jun 13 '26
When I was working with Java, we would use Spring Health Actuator to indicate if that service was healthy.
For example, we could go to the health endpoint and get the following:
* Database connections are healthy
* gRPC routes working to other services
* Kafka connections working
* RabbitMQ connection working
And we could set that all up via a yaml file or through Beans.