CronPup

← Guides

Monitoring Google Cloud Scheduler and Cloud Run jobs

Cloud Scheduler triggers an HTTP target, Pub/Sub topic or Cloud Run job, and logs the attempt. What it doesn't do is tell you that the work behind it actually finished. A heartbeat sent by the job itself closes that gap.

Cloud Run job or function

Send the ping as the last step of the code, after the real work succeeded:

import urllib.request

def main():
    do_the_work()
    urllib.request.urlopen("https://cronpup.com/p/YOUR-UUID", timeout=10)

On an exception, request https://cronpup.com/p/YOUR-UUID/fail before re-raising, so the failure alerts at once.

Mirror the schedule

Cloud Scheduler uses unix-cron format with a timezone, the same as a CronPup cron monitor. Copy both, then set the grace period to the job's typical runtime plus retries.

Why not just log-based alerts?

Log alerts fire on something that happened. A missing run is something that didn't happen, which is much easier to catch with a deadline than with a log query. Start free.