SiteBrief/Documentation

Heartbeat Monitoring

Monitor cron jobs, queue workers, and scheduled tasks. Instead of SiteBrief checking your site, your task pings SiteBrief on each run.

The concept

Normal uptime monitoring is active: SiteBrief checks your site. Heartbeat monitoring is passive: your task or script sends a signal ("heartbeat") to SiteBrief after each successful run. If a heartbeat doesn't arrive within the expected interval, SiteBrief alerts you.

Think of it as a "dead man's switch" — as long as your task keeps pinging, everything is fine. Silence means something went wrong.

💡
Tip:Heartbeat monitoring is the only way to know whether a scheduled task ran successfully. Uptime monitoring can tell you if a server is up — it can't tell you if last night's backup cron actually completed.

What you can monitor

  • Backup scripts — daily/weekly database or file backups
  • Cron jobs — any scheduled Linux/cron task
  • Queue workers — Laravel, Sidekiq, Celery, Bull, etc.
  • Report generation — automated email or PDF generation tasks
  • Data sync scripts — ETL pipelines, API sync jobs
  • Database maintenance — vacuums, index rebuilds, integrity checks

How to set it up

When adding a monitor, select Heartbeat as the check type. SiteBrief generates a unique heartbeat URL for that monitor. Add a ping to that URL at the end of your task.

SettingDescription
Heartbeat intervalHow often your task is expected to run (e.g. 24 hours for a daily backup)
Grace periodExtra time allowed before an alert is sent — useful if tasks sometimes run a bit late

The heartbeat URL accepts any HTTP method (GET or POST). No authentication is needed — the unique URL is the secret.

Integration examples

Linux cron (bash)

bash
# Run backup, then ping SiteBrief
0 2 * * * /usr/local/bin/backup.sh && curl -fsS https://app.sitebrief.net/hb/YOUR-UUID > /dev/null

PHP / Laravel scheduler

php
$schedule->command('backup:run')
    ->daily()
    ->thenPing('https://app.sitebrief.net/hb/YOUR-UUID');

Python

python
import requests

def run_backup():
    # ... your backup logic ...
    pass

if __name__ == '__main__':
    run_backup()
    requests.get('https://app.sitebrief.net/hb/YOUR-UUID')

Node.js

javascript
const https = require('https');

async function runTask() {
  // ... your task logic ...
  await fetch('https://app.sitebrief.net/hb/YOUR-UUID');
}
⚠️
Warning:Send the heartbeat afterthe task completes successfully, not before. If you ping first and then the task fails, SiteBrief won't know about the failure.

Grace period

The grace period is extra time added on top of the expected interval before an alert fires. For example, if your cron runs every 24 hours with a 1-hour grace period, SiteBrief will alert you only if no heartbeat arrives within 25 hours.

Set a grace period that matches how variable your task's runtime is:

Task typeRecommended grace period
Fast script (seconds)5–15 minutes
Medium task (minutes)30–60 minutes
Heavy process (backups, ETL)2–4 hours
Weekly task12 hours

Frequently asked questions

What happens if the server is down and can't send the heartbeat?
SiteBrief will alert you — which is exactly what you want. If the server can't reach the internet to ping the heartbeat URL, something is seriously wrong. You'll get both a heartbeat alert and potentially an uptime alert for the server itself.
Can I have multiple heartbeats for the same server?
Yes. Each task or cron job gets its own heartbeat monitor with its own URL and interval. For example, a server might have one heartbeat for "daily backup" and another for "weekly cleanup".
How is heartbeat monitoring different from uptime monitoring?
Uptime monitoring checks that your server is responding to HTTP requests. Heartbeat monitoring checks that a specific task completed. A server can be "up" (responding to HTTP) while a backup script silently fails.
Can the heartbeat URL accept a POST request with status data?
Yes. SiteBrief accepts GET and POST. The response body of POST requests is currently ignored — only the fact of the request arriving matters. Future versions may allow you to send exit codes or run duration.