Help & guides ›
Heartbeat (cron monitoring)
› What is heartbeat and when to use it
What is heartbeat and when to use it
3 min read · Heartbeat (cron monitoring)
In short: A heartbeat monitor will alert you when a task (typically a nightly backup, daily sync or other cron job) stops running. It works the opposite way to a classic uptime monitor - you send the "ping" towards ePulz.io, not we to your server.
When a heartbeat is useful
- Nightly database backups - you want to know if a backup fails at night
- Synchronization with an external service - import from CRM, accounting, payment processor
- Recurring invoicing - generating invoices, sending reminders
- Cleanup tasks - deleting old sessions, temp files, logs
- Reports and statistics - weekly/monthly reports
- Healthcheck of background workers - Celery, Sidekiq, BullMQ
How it works
- In ePulz.io you create a heartbeat monitor with the expected interval (e.g. every hour, every night at 3:00, etc.)
- You receive a unique heartbeat URL - looks like
https://epulz.io/heartbeat/abc123xyz - You add this URL at the end of your cron script / task
- When the task finishes successfully, it "pings" this URL
- If the ping does not arrive at the expected time (+ grace period), ePulz.io alerts you
Practical example
Imagine a nightly database backup that runs every day at 3:00 am and takes ~5 minutes:
- You create a heartbeat monitor named "Nightly DB backup", interval 1440 minutes (24 hours), grace 15 minutes
- To the backup script you add: after a successful backup, call the heartbeat URL
- Every day after 3:05 ePulz.io expects a ping. If it does not come by 3:15 (interval + grace), it will send you an alert
Key principle:
You call the heartbeat URL only after a successful completion of the task. If the script fails, the ping does not go through, ePulz.io finds out and alerts you. No ping = outage.
Interval vs Grace
- Interval - how often the heartbeat should arrive (e.g. every hour = 60 minutes)
- Grace - tolerance, how long to wait after the expected time before we trigger an alert
Practical values:
| Task | Interval | Grace |
|---|---|---|
| Every hour | 60 min | 10 min |
| Daily backup (averages 20 min) | 1440 min | 60 min |
| Weekly report | 10080 min | 6 hours |
| Every 5 minutes worker check | 5 min | 2 min |
Get started
In the next step we show the exact procedure for creating a heartbeat monitor in the ePulz.io dashboard.