How to monitor

A status page for your Rails app

Monitor your Ruby on Rails app, API, Sidekiq workers and database, watch SSL expiry, and publish a custom-domain status page — in minutes, with nothing to install.

StatusCat2 min read

A Rails app is rarely just the web server: there's the API, Sidekiq (or another job processor), the database, and usually Redis behind it. Each fails on its own. Monitoring them and rolling the results into one status page gives you and your users a clear signal. Here's how — with nothing to install.

What to monitor in a Rails app

  • The web app — an HTTP check on your main URL with a keyword assertion.
  • The API — a check on a /health route (see how to monitor an API).
  • Sidekiq workers — heartbeats, so a stalled queue pages you.
  • The database & Redis — query/command heartbeats (see PostgreSQL and Redis guides).
  • SSL certificate — expiry monitoring (SSL guide).

Add a health route

# config/routes.rb
get "/health", to: "health#show"

# app/controllers/health_controller.rb
class HealthController < ApplicationController
  def show
    ActiveRecord::Base.connection.execute("SELECT 1") # touch the DB
    render json: { status: "ok" }
  end
end

Point a StatusCat HTTP monitor at /health with a keyword assertion on "status":"ok". If the database is unreachable, the action raises and the monitor trips.

Monitor Sidekiq with a heartbeat

Add a recurring job that pings StatusCat, so a stalled worker is caught:

# app/jobs/heartbeat_job.rb
class HeartbeatJob < ApplicationJob
  def perform
    Net::HTTP.get(URI("https://statuscat.co/ping/your-sidekiq-id"))
  end
end

Schedule it every few minutes (e.g. with sidekiq-cron). If the ping stops arriving, StatusCat alerts you. (More in how to monitor a cron job.)

Publish the status page

  1. Group your monitors (web, API, workers, database, Redis).
  2. Create a status page and add them as components.
  3. Point it at status.yourapp.com.
  4. Enable email subscribers for incident updates.

StatusCat does all of this from the outside, free for 50 monitors, with on-call and status pages included. New to monitoring? Start with what uptime monitoring is. On Django or Laravel instead? See status page for Django and status page for Laravel.

Frequently asked questions

Do I need a gem to monitor my Rails app?
No. StatusCat monitors from the outside over HTTP. Optionally add a lightweight /health route so the check exercises your critical path (database, Redis), and use heartbeat pings from Sidekiq.
How do I monitor Sidekiq workers?
Use heartbeat monitors. Have a recurring job (via sidekiq-cron or a scheduled task) ping StatusCat on a healthy cycle; if the ping stops, you're alerted that Sidekiq has stalled.
Can the status page use my own domain?
Yes — custom domains, private pages, subscribers and 90-day uptime history are supported.

Keep reading