First heartbeat
Monitor your cron jobs and background workers with a heartbeat check.
What is a heartbeat?
A heartbeat monitor is the inverse of an HTTP monitor. Instead of the platform calling your service, your service calls the platform. At the end of each scheduled job, your script sends an HTTP ping to a unique heartbeat URL. If no ping arrives within the expected window, an incident is triggered.
Use heartbeats for:
- Cron jobs (backups, report generation, data sync)
- Background workers (queue consumers, scheduled tasks)
- Any process that should run on a schedule
Create a heartbeat
- In the sidebar, click Heartbeats.
- Click + New Heartbeat.
- Fill in the fields:
| Field | Example | Notes |
|---|---|---|
| Name | Daily DB backup | Human-readable label |
| Expected interval | 24h | How often the job runs |
| Grace period | 10m | Extra time before alerting |
- Click Save.
- Copy the generated ping URL — you will add it to your script.
Send the ping from your script
At the end of your job (after successful completion), send an HTTP POST to the ping URL:
# Basic curl ping
curl -sS -X POST https://api.example.com/api/v1/hb/YOUR_HEARTBEAT_ID
Only ping when the job completes successfully. If the job errors, skip the ping — the platform will alert you automatically when the grace period expires.
Integration examples
Crontab
# Add || true so cron itself does not fail if the ping fails
*/60 * * * * /path/to/backup.sh && curl -sS -X POST https://api.example.com/api/v1/hb/YOUR_HEARTBEAT_ID || true
systemd timer
[Service]
ExecStart=/path/to/worker.sh
ExecStartPost=curl -sS -X POST https://api.example.com/api/v1/hb/YOUR_HEARTBEAT_ID
Node.js
// At the end of your scheduled job
await fetch('https://api.example.com/api/v1/hb/YOUR_HEARTBEAT_ID', { method: 'POST' })
.catch(() => console.warn('Heartbeat ping failed'));
Python
import requests
def run_job():
# ... your job logic ...
requests.post('https://api.example.com/api/v1/hb/YOUR_HEARTBEAT_ID', timeout=5)
if __name__ == '__main__':
run_job()
Grace period
The grace period is extra time beyond the expected interval before the platform considers the job late.
Example: interval = 5 minutes, grace period = 2 minutes. The platform triggers an incident at T+7 min if no ping is received. Use a grace period when your job has variable runtime.
Heartbeat statuses
| Status | Meaning |
|---|---|
| Up | Last ping received within interval + grace period |
| Late | Interval exceeded but within grace period |
| Down | Grace period exceeded — incident opened, alert sent |
| New | No pings received yet since creation |
What's next
- First status page — publish uptime data publicly
- Concepts: Heartbeats — full reference for heartbeat configuration
Was this page helpful?