Ruby on Rails

Rails ऐप्स के लिए स्टेटस पेज और अपटाइम मॉनिटरिंग

Rails controllers, Active Record, Sidekiq queues, Redis मॉनिटर करें। सुंदर स्टेटस पेज या हमारी API से अपनी बनाएं।

Ruby on Rails के लिए स्टेटस पेज लॉन्च करने के तीन तरीके

नियंत्रण का स्तर चुनें — zero-code, low-code, या पूर्ण headless।

Hosted

अपना Ruby on Rails endpoint जोड़ें, CNAME को status.yourdomain.com पर point करें, हो गया। 5 मिनट में।

Headless

Public API का उपयोग करके अपनी Ruby on Rails ऐप के अंदर अपनी UI बनाएं। डिज़ाइन और ब्रांडिंग पर पूरा नियंत्रण।

API देखें

एम्बेडेड badges

अपने README या landing page में SVG uptime और status badges डालें। हर 5 मिनट में auto-update।

इस health endpoint को अपनी Ruby on Rails ऐप में जोड़ें

Copy, paste, PulseAPI को URL पर point करें। स्वस्थ पर 200, degraded पर 503 return करता है।

app/controllers/health_controller.rb
class HealthController < ApplicationController
  skip_before_action :authenticate_user!, raise: false

  def show
    checks = {
      database: active_record_ok? ? "ok" : "fail",
      cache: cache_ok? ? "ok" : "fail",
      sidekiq: sidekiq_ok? ? "ok" : "fail",
    }
    healthy = checks.values.all? { |v| v == "ok" }
    render json: { status: healthy ? "healthy" : "degraded", **checks },
           status: healthy ? 200 : 503
  end

  private

  def active_record_ok?
    ActiveRecord::Base.connection.execute("SELECT 1") && true
  rescue StandardError
    false
  end

  def cache_ok?
    Rails.cache.write("health:probe", "1", expires_in: 5.seconds)
    Rails.cache.read("health:probe") == "1"
  rescue StandardError
    false
  end

  def sidekiq_ok?
    Sidekiq.redis { |c| c.ping == "PONG" }
  rescue StandardError
    false
  end
end

routes.rb में `get "/health", to: "health#show"` से connect करें। CSRF, auth, और monitor probe को 401 देने वाला middleware skip करें।

Ruby on Rails ऐप्स में क्या टूटता है — और कैसे पकड़ें

चुपचाप बढ़ती Sidekiq queues

अटका worker queue को बढ़ाता जाता है। Queue-depth endpoint बनाएं और threshold पर assert करें।

N+1 regressions

छूटा .includes() response time को 10x कर सकता है। Assertions deploy के बाद पहले मिनट में regression पकड़ लेते हैं।

Connection pool खाली हो जाना

लंबी queries pool block करती हैं। जल्दी timeout वाला health endpoint ActionCable के users drop होने से पहले issue दिखाता है।

Headless angle

हमारा स्टेटस पेज पसंद नहीं? Ruby on Rails में अपना बनाएं।

हमारी API वही data लौटाती है जो हमारी hosted UI उपयोग करती है। पूर्ण OpenAPI spec यहां api.pulseapi.tech/docs.

app/controllers/status_controller.rb — हमारी API के ऊपर अपनी status UI बनाएं।
require "net/http"
require "json"

class StatusController < ApplicationController
  def show
    uri = URI("https://api.pulseapi.tech/status/acme")
    @data = JSON.parse(Net::HTTP.get(uri))
  end
end

Ruby on Rails मॉनिटरिंग — FAQ

क्या यह Rails, Sinatra, Hanami, या Padrino के साथ काम करता है?

हां। Monitoring HTTP-level पर है — framework मायने नहीं रखता।

Sidekiq queue कैसे मॉनिटर करूं?

Action से queue depth return करें और threshold exceed पर alert करें। JSON-path support है: `$.queue_depth < 100`।

क्या यह Heroku, Fly.io, और Render के साथ काम करता है?

हां, किसी भी deployment के साथ। PulseAPI को बस public URL चाहिए।

क्या Rails ऐप के अंदर स्टेटस पेज embed कर सकता हूं?

हां। Controller से public API hit करें, template render करें, या turbo_frame के साथ server-rendered partial use करें।

अपनी Ruby on Rails ऐप की मॉनिटरिंग 5 मिनट में शुरू करें

मुफ्त tier, कोई credit card नहीं। अपना endpoint जोड़ें और टूटने पर alerts पाएं।