explaingit

eclectic-coding/rails_health_checks

Analysis updated 2026-05-18

14RubyAudience · developerComplexity · 2/5Setup · easy

TLDR

A Ruby gem that adds liveness and readiness health check endpoints to Rails apps, with eleven built-in checks for databases, caches, and job queues.

Mindmap

mindmap
  root((RailsHealthChecks))
    What it does
      Liveness endpoint
      Readiness endpoint
      Eleven checks
    Tech stack
      Ruby
      Rails
      Sidekiq
    Use cases
      Kubernetes probes
      Prometheus metrics
    Audience
      Rails developers
      DevOps teams

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add separate liveness and readiness endpoints so Kubernetes restarts containers only when the process itself is actually down.

USE CASE 2

Check the health of a database, Redis, Sidekiq, and disk space through one gem instead of writing custom checks.

USE CASE 3

Expose a Prometheus-format metrics endpoint for monitoring dashboards.

USE CASE 4

Isolate worker health checks from database health checks using named check groups.

What is it built with?

RubyRailsSidekiqRedisPrometheus

How does it compare?

eclectic-coding/rails_health_checksfastlane/taskqueuerkh/hpi
Stars141316
LanguageRubyRubyRuby
Last pushed2019-07-292011-10-28
MaintenanceDormantDormant
Setup difficultyeasyeasymoderate
Complexity2/52/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Works in plain Rack apps like Sinatra or Roda without requiring the full Rails stack.

In plain English

RailsHealthChecks is a Ruby gem that adds health check web endpoints to a Rails application. Health checks are special URLs that monitoring systems, load balancers, and container orchestrators (like Kubernetes) call repeatedly to find out whether a running application is healthy. Rails ships with a basic one at a fixed path, but this gem expands on it substantially. The gem adds two main endpoint types. A liveness endpoint simply confirms that the server process is running. It always returns success as long as the Ruby process is alive. A readiness endpoint goes further, actively testing whether each external dependency the app relies on is reachable and working. If the database is down, or the cache is unresponsive, the readiness endpoint returns a failure status. This distinction matters in Kubernetes and behind load balancers: if a liveness check fails, the container gets restarted, if a readiness check fails, the load balancer stops sending traffic to that instance without restarting it. Conflating the two can cause unnecessary restarts or cascade failures, which is why the gem treats them separately. Eleven checks come built in: database, cache, Redis, email sending via SMTP, and several background job systems (Sidekiq, SolidQueue, GoodJob, Resque), plus disk space, available memory, and the ability to reach an external HTTP URL. Checks run in parallel so total response time is capped by the slowest single check rather than the sum of all of them. Results can be cached for a configurable duration to avoid overloading dependencies when monitoring tools probe frequently. The gem also exposes a Prometheus-format metrics endpoint for teams that collect metrics through that system. Named check groups let operators expose subsets of checks at separate URLs, for example isolating worker health from database health. Authentication is supported via bearer token, IP allowlist, or a custom code block. A generator command creates a commented configuration file. The gem works in plain Rack applications (Sinatra, Roda, etc.) without requiring the full Rails stack for checks that do not depend on Rails internals. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Help me add RailsHealthChecks to my Rails app with a readiness endpoint for my database and Redis.
Prompt 2
Show me how to set up a Prometheus metrics endpoint using RailsHealthChecks.
Prompt 3
Explain the difference between the liveness and readiness endpoints this gem provides.
Prompt 4
Walk me through securing my health check endpoints with a bearer token.

Frequently asked questions

What is rails_health_checks?

A Ruby gem that adds liveness and readiness health check endpoints to Rails apps, with eleven built-in checks for databases, caches, and job queues.

What language is rails_health_checks written in?

Mainly Ruby. The stack also includes Ruby, Rails, Sidekiq.

How hard is rails_health_checks to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is rails_health_checks for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.