Skip to content

Heartbeat Checks

Heartbeat monitors work in reverse compared to other monitor types. Instead of YipYap reaching out to your service, your service sends a ping to YipYap on a schedule. If the ping does not arrive within the expected window, the monitor fires an alert.

FieldDescriptionDefault
Expected IntervalHow often your service should ping (e.g. every 5 minutes).Required
Grace PeriodExtra time to allow before marking the check as failed.30s

When you create a heartbeat monitor, YipYap generates a unique push URL:

https://console.yipyap.run/api/v1/heartbeat/<monitor-id>

Your service sends an HTTP GET or POST to this URL each time it completes a run.

  1. Your service pings the push URL after each successful execution.
  2. YipYap records the timestamp of each ping.
  3. If no ping arrives within the expected interval plus the grace period, the monitor transitions to Down and fires an alert.
  4. When the next ping arrives, the monitor recovers automatically.
  • Monitoring cron jobs (e.g. database backups, report generation).
  • Verifying that a queue worker is processing jobs on schedule.
  • Checking that a periodic data sync is completing successfully.

Add a curl call at the end of your cron script:

#!/bin/bash
# Run the backup
pg_dump mydb > /backups/mydb.sql
# Signal success to YipYap
curl -fsS --retry 3 -X POST https://console.yipyap.run/api/v1/heartbeat/abc123
  • Set the grace period to at least 30 seconds longer than your job’s typical duration to avoid false alerts.
  • If your job can fail silently, only send the ping after verifying the job succeeded.
  • For jobs that run infrequently (e.g. once per day), set the expected interval accordingly and use a longer grace period.