Dead Man's Snitch

This add-on is operated by Collective Idea

Dead simple monitoring for Heroku Scheduler, cron, or any periodic process

Dead Man's Snitch

Last Updated: 03 December 2013

The Dead Man's Snitch add-on is currently in beta.

Table of Contents

Dead Man’s Snitch is an add-on for monitoring your periodic processes such as Heroku Scheduler or cron.

Ever have a periodic process fail to run? Make a code change and your nightly backups fail? Weekly emails not send and you don’t notice until a customer complains? Dead Man’s Snitch has you covered.

We’ll notifify you when your processes don’t run, allowing you to react quickly to correct the problem.

Dead Man’s Snitch makes monitoring periodic processes dead simple.

Provisioning the add-on

Dead Man’s Snitch can be attached to a Heroku application via the CLI:

A list of all plans available can be found here.

$ heroku addons:add deadmanssnitch
-----> Adding deadmanssnitch to collective-idea-4005... done, v18 (free)

Once Dead Man’s Snitch has been added a DEAD_MANS_SNITCH_URL setting will be available in the app configuration and will contain the canonical URL to access Dead Man’s Snitch. This can be confirmed using the heroku config:get command.

$ heroku config:get DEAD_MANS_SNITCH_URL
https://deadmanssnitch.com

After installing Dead Man’s Snitch, sign in to the Dashboard to configure your Snitches to monitor your processes.

Creating a Snitch in the Dashboard

Using with Heroku Scheduler

These examples use pgbackups-archive for saving off-site backups. Read more about it in this blog post.

Integrating into Heroku Scheduler is simple. You simply add a curl command after your existing jobs.

Example of Heroku Scheduler

For each Snitch you create, curl the unique URL (replacing the URL in these examples with your own) from the Snitch after each job:

Example of adding DMS to Heroku Scheduler

If our original job was:

rake pgbackups:archive

We’d change that to:

rake pgbackups:archive && curl https://nosnch.in/208cd43444

You can pass custom data to your Snitch

rake pgbackups:archive && curl -d "m=just checking in" https://nosnch.in/208cd43444

You can even time your jobs and pass the result to your snitch:

m=time ( rake pgbackups:archive &> /dev/null) 2>&1 && curl -d "m=$m" https://nosnch.in/208cd43444

Using inside your code

You can use Dead Man’s Snitch from any language that can fetch a URL.

In Ruby, a simple example is:

require 'open-uri'

response = open("https://nosnch.in/208cd43444")

Put it after some complex code, and Dead Man’s Snitch will alert you if it fails to run.

URLs will return a 2xx HTTP status code.

Dashboard

For more information on the features available within the Dead Man’s Snitch dashboard please see the docs at deadmanssnitch.com/faq.

The Dead Man’s Snitch dashboard allows you to configure Snitches to monitor your processes. Each Snitch gives you a unique URL and notification settings.

Dead Man's Snitch Dashboard

The dashboard can be accessed via the CLI:

$ heroku addons:open deadmanssnitch
Opening deadmanssnitch for collective-idea-4005…

or by visiting the Heroku apps web interface and selecting the application in question. Select Dead Man’s Snitch from the Add-ons menu.

Troubleshooting

The most common issues is grabbing the wrong URL for a Snitch. Double-check that you copy it correctly.

In most setups, Dead Man’s Snitch won’t get notified if the process it is monitoring fails. Make sure your process is actually working and exiting properly.

Migrating between plans

Use the heroku addons:upgrade command to migrate to a new plan.

$ heroku addons:upgrade deadmanssnitch:newplan
-----> Upgrading deadmanssnitch:newplan to collective-idea-4005... done, v18 ($19/mo)
       Your plan has been updated to: deadmanssnitch:newplan

Removing the add-on

Dead Man’s Snitch can be removed via the CLI.

This will destroy all associated data and cannot be undone!

$ heroku addons:remove deadmanssnitch
-----> Removing deadmanssnitch from collective-idea-4005... done, v20 (free)

Support

All Dead Man’s Snitch support and runtime issues should be submitted via one of the Heroku Support channels. Any non-support related issues or product feedback is welcome at via email to hi@deadmanssnitch.com.