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.
Configuration
Section titled “Configuration”| Field | Description | Default |
|---|---|---|
| Expected Interval | How often your service should ping (e.g. every 5 minutes). | Required |
| Grace Period | Extra time to allow before marking the check as failed. | 30s |
Push URL
Section titled “Push URL”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.
How It Works
Section titled “How It Works”- Your service pings the push URL after each successful execution.
- YipYap records the timestamp of each ping.
- If no ping arrives within the expected interval plus the grace period, the monitor transitions to Down and fires an alert.
- When the next ping arrives, the monitor recovers automatically.
Use Cases
Section titled “Use Cases”- 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.
Integration Example
Section titled “Integration Example”Add a curl call at the end of your cron script:
#!/bin/bash# Run the backuppg_dump mydb > /backups/mydb.sql
# Signal success to YipYapcurl -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.