Monitor Rails Active Job with CronRabbit

Ruby on Rails

The 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

Ruby
class 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

Ready to Monitor Your Cron Jobs?

Create your free account and add your first monitor in under 5 minutes. No credit card required.