
Ruby on Rails powers a surprising number of production web applications — from early-stage startups to large-scale platforms like GitHub, Shopify, and Basecamp. Rails applications have a distinct architecture that requires a tailored approach to uptime monitoring.
This guide covers practical Rails application monitoring — health endpoints, background job monitoring, database checks, and alert configuration.
A production Rails deployment typically includes:
Each component can fail independently. A Sidekiq process dying won't prevent your web app from responding, but emails stop sending and background processing halts.
Add a dedicated health endpoint that verifies your application stack:
# Gemfile
gem 'health_check'
# config/routes.rb
health_check_routes
Or add a minimal custom controller:
# app/controllers/health_controller.rb
class HealthController < ApplicationController
skip_before_action :authenticate_user!, raise: false
def show
ActiveRecord::Base.connection.execute("SELECT 1")
render json: { status: 'ok' }
rescue => e
render json: { status: 'error', message: e.message }, status: 503
end
end
# config/routes.rb
get '/health', to: 'health#show'
This checks database connectivity and returns 503 on failure. Point your uptime monitor at /health.
With your health endpoint in place, configure an external monitor:
https://yourdomain.com/health"status":"ok"External monitoring from Domain Monitor confirms your app is reachable from the public internet — it catches networking failures, server crashes, and SSL issues that internal checks might miss.
Sidekiq is one of the most common failure points in Rails applications. Workers can die due to memory limits, signal handling issues, or deployment problems — and unlike web requests, failed jobs don't immediately manifest as user-visible errors.
Add a periodic heartbeat job to your Sidekiq configuration:
# app/workers/health_ping_worker.rb
class HealthPingWorker
include Sidekiq::Worker
def perform
require 'net/http'
Net::HTTP.get(URI.parse(ENV['HEARTBEAT_URL']))
end
end
# config/schedule.yml (with sidekiq-cron)
health_ping:
cron: "*/5 * * * *"
class: HealthPingWorker
If Sidekiq stops processing jobs, the heartbeat stops arriving, and you receive an alert. See heartbeat monitoring for full details.
If your Rails app uses Action Cable for real-time features, consider monitoring your cable endpoint separately. A basic HTTP check on the cable mount point confirms the WebSocket upgrade path is available.
Your health endpoint should check both database and Redis connectivity:
def show
checks = {}
# Database check
ActiveRecord::Base.connection.execute("SELECT 1")
checks[:database] = 'ok'
rescue ActiveRecord::ConnectionNotEstablished => e
checks[:database] = 'error'
return render json: { status: 'error', checks: checks }, status: 503
end
begin
# Redis check
Redis.current.ping
checks[:redis] = 'ok'
rescue Redis::CannotConnectError => e
checks[:redis] = 'error'
return render json: { status: 'degraded', checks: checks }, status: 503
end
render json: { status: 'ok', checks: checks }
This gives your monitoring tool clear signal: the app is up, the database is up, Redis is up.
Rails applications on Heroku have some unique monitoring considerations:
For Heroku deployments, see also how to monitor Heroku applications.
Don't forget SSL certificate monitoring and domain expiry monitoring — these are independent of your Rails stack but can take your app offline just as effectively as an application crash.
Configure alerts via email, SMS, and Slack. For Rails applications, Slack is particularly useful — a #rails-monitoring channel means your engineering team sees alerts immediately during business hours.
/health endpoint checking database + Redis connectivityMonitor your Ruby on Rails application at Domain Monitor.
Generative AI creates new content — text, images, code, and more. This guide explains how it works, what tools are available, and where it's genuinely useful versus overhyped.
Read moreCursor AI is an AI-powered code editor built on VS Code. Learn what it does, how it works, and whether it's the right tool for your development workflow.
Read moreClaude Opus is Anthropic's most capable AI model, built for complex reasoning and demanding tasks. Learn what it does, how it compares, and when to use it.
Read moreLooking to monitor your website and domains? Join our platform and start today.