CronCanary DocsPricingOpen app
← Integration guides

Monitor a Python job

Ping from any Python scheduler — a plain script, APScheduler, or Celery beat.

Plain script

import requests URL = "$URL" try: requests.get(URL + "/start", timeout=5) do_the_work() requests.get(URL, timeout=5) # success except Exception: requests.get(URL + "/fail", timeout=5) # failure -> alert raise

A reusable decorator

import functools, requests def monitored(url): def deco(fn): @functools.wraps(fn) def wrap(*a, **k): requests.get(url + "/start", timeout=5) try: r = fn(*a, **k); requests.get(url, timeout=5); return r except Exception: requests.get(url + "/fail", timeout=5); raise return wrap return deco @monitored("$URL") def nightly_report(): ...

Celery beat

Call the ping at the end of the task body, or wrap the task with the decorator above. Give the check a Cron schedule matching your crontab(...) beat entry.


Ready to wire this up? Create a free check — 20 checks, all alert channels, no card.