Monitor Rails Active Job with CronRabbit
Ruby on RailsThe Problem
Rails Active Job abstracts the queue backend, but none of the backends (Sidekiq, Resque, Delayed Job) have built-in external alerting for missed schedules.
The Solution
Add CronRabbit pings inside your Active Job perform method. Works identically regardless of queue adapter.
Integration
The same monitoring code works whether you're using Sidekiq, Resque, or Delayed Job as your Active Job adapter.
Code Examples
Active Job with monitoring
Rubyclass DailyReportJob < ApplicationJob
queue_as :default
PING = "https://ping.cronrabbit.com/your-id"
def perform
Net::HTTP.get(URI("#{PING}/start")) rescue nil
begin
ReportService.generate_daily
Net::HTTP.get(URI(PING)) rescue nil
rescue => e
Net::HTTP.get(URI("#{PING}/fail")) rescue nil
raise
end
end
end