Heartbeat monitors
An HTTP monitor reaches into your service from outside. A heartbeat is the opposite: your job reports out by pinging a private URL each run, and if the expected ping doesn't arrive in time, we open an incident.
When to use it
Anything scheduled and invisible from the outside — nightly backups, cron jobs, queue workers, ETL runs. There's no public URL to poll, so instead of us checking in, the job checks out.
How it works
- Create a heartbeat on the Monitors page. It gets a private ping URL: https://goodpinger.com/p/<id>.
- Your job requests that URL on each successful run.
- Each ping re-arms a timer set to the monitor's interval.
- If the next ping doesn't arrive before the timer elapses, the monitor goes down and an incident opens — “the job didn't run”.
Setup: a plain cron job (curl)
Append a curl to the end of your command so it pings only when the job succeeds. This works anywhere and the bare GET endpoint is stable forever.
# crontab — ping only when the job actually succeeds 0 3 * * * /opt/backup.sh && curl -fsS https://goodpinger.com/p/<your-id>
-f makes curl fail on an error response and -s keeps it quiet; the ping runs only if your command exited 0.
Setup: the gpr agent (richer)
Wrap the command with the agent instead. It reports the run's start and its exit code, so a run that FAILED (non-zero exit) is distinguished from one that never ran — and the captured error output attaches to the incident.
gpr run --slug <your-id> -- /opt/backup.sh
Choosing the interval
Set the interval a little longer than the job's normal cadence plus its runtime — an hourly job that takes two minutes wants ~1h. Too tight and a slow run alerts falsely; too loose and a real miss is noticed late.
Good to know
- The ping URL is a secret capability — anyone who has it can ping. Treat it like a token; delete the monitor to rotate it.
- Pausing a heartbeat stops both the timer and its alerts.
- A plain GET is all a ping needs, so a one-line curl in crontab is enough; the agent is optional and adds the exit code + error context.