Monitor Heroku Scheduler Tasks with CronRabbit

Heroku

The Problem

Heroku Scheduler runs tasks as one-off dynos, but has no built-in failure alerting. If a task crashes, OOMs, or Heroku Scheduler itself has issues, you won't know.

The Solution

Add CronRabbit pings to your Heroku Scheduler task scripts. The dead man's switch catches both task failures and Scheduler outages.

Integration

Add the monitoring ping to your Rake task, Node.js script, or Python command that Heroku Scheduler invokes.

Code Examples

Heroku Scheduler Rake task

Ruby
# lib/tasks/scheduler.rake
task cleanup: :environment do
  require 'net/http'
  ping = "https://ping.cronrabbit.com/your-id"
  Net::HTTP.get(URI("#{ping}/start")) rescue nil
  begin
    CleanupService.run
    Net::HTTP.get(URI(ping)) rescue nil
  rescue => e
    Net::HTTP.get(URI("#{ping}/fail")) rescue nil
    raise
  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.