Help & guidesHeartbeat (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

  1. In ePulz.io you create a heartbeat monitor with the expected interval (e.g. every hour, every night at 3:00, etc.)
  2. You receive a unique heartbeat URL - looks like https://epulz.io/heartbeat/abc123xyz
  3. You add this URL at the end of your cron script / task
  4. When the task finishes successfully, it "pings" this URL
  5. 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:

  1. You create a heartbeat monitor named "Nightly DB backup", interval 1440 minutes (24 hours), grace 15 minutes
  2. To the backup script you add: after a successful backup, call the heartbeat URL
  3. 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:

TaskIntervalGrace
Every hour60 min10 min
Daily backup (averages 20 min)1440 min60 min
Weekly report10080 min6 hours
Every 5 minutes worker check5 min2 min

Get started

In the next step we show the exact procedure for creating a heartbeat monitor in the ePulz.io dashboard.

Next step:

Creating a heartbeat monitor in ePulz.io.

Create a heartbeat monitor ->