Home / Docs / Heartbeat Monitoring

Monitoring

Heartbeat Monitoring

Track cron jobs and background workers with ping-based monitoring.

Heartbeat monitors track jobs that should ping PulseBeacon on a known schedule. With interval scheduling, if pings stop arriving the monitor transitions from up to late and then down, which can trigger alerts and incidents.

Real Endpoint Pattern

Heartbeat pings use https://pulsebeacon.io/ping/{CHECK_CODE}. Supported methods: GET and POST. Optional runtime keys: rt, runtime, or runtime_ms.

How Heartbeat Scheduling Works

Mode Fields Behavior
Interval Interval + Grace period Expected every X seconds; after interval+grace monitor becomes late, then down if still missing.
Cron Cron expression + Timezone + Grace period The next ping is expected at the next cron run (in your timezone) after the last ping. Past that time plus grace the monitor becomes late, then down after a further full schedule window.

Staged Escalation, No False Alarms

Both modes escalate in two stages: Late (warning) first, Down only after a further full window. The grace period absorbs normal cron jitter and queue delays, so a slightly delayed job does not alert. Invalid cron expressions are rejected when saving.

Plan Limits

Minimum allowed interval is plan-based. Free plan defaults to 300s minimum; paid plans allow faster intervals.

Common Use Cases

  • Nightly backups
  • Queue workers that must execute continuously
  • Periodic data imports or sync jobs
  • Invoice/cleanup cron scripts
  • Any scheduled process that should report completion

Examples

curl (GET)
curl -fsS "https://pulsebeacon.io/ping/YOUR_CHECK_CODE"
curl (with runtime)
curl -fsS "https://pulsebeacon.io/ping/YOUR_CHECK_CODE?rt=842"
Shell Script
#!/usr/bin/env bash
set -euo pipefail

# run job
/usr/local/bin/nightly-import

# ping PulseBeacon after successful completion
curl -fsS "https://pulsebeacon.io/ping/YOUR_CHECK_CODE" >/dev/null
Cron Entry
*/5 * * * * /usr/local/bin/run-job.sh && curl -fsS "https://pulsebeacon.io/ping/YOUR_CHECK_CODE" >/dev/null
PHP cURL
// PHP example
$pingUrl = 'https://pulsebeacon.io/ping/YOUR_CHECK_CODE?runtime_ms=1200';

$ch = curl_init($pingUrl);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 10,
]);

curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode !== 200) {
    error_log('PulseBeacon ping failed: HTTP ' . $httpCode);
}
Laravel Scheduler
// Laravel example
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Schedule;

Schedule::command('reports:generate')
    ->hourly()
    ->onSuccess(function () {
        Http::timeout(10)->get('https://pulsebeacon.io/ping/YOUR_CHECK_CODE');
    });
JavaScript (fetch)
await fetch('https://pulsebeacon.io/ping/YOUR_CHECK_CODE', {
  method: 'GET',
  keepalive: true,
});
Node.js
import https from 'node:https';

https.get('https://pulsebeacon.io/ping/YOUR_CHECK_CODE', (res) => {
  if (res.statusCode !== 200) {
    console.error('PulseBeacon ping failed:', res.statusCode);
  }
}).on('error', console.error);
Ruby
require 'net/http'

uri = URI('https://pulsebeacon.io/ping/YOUR_CHECK_CODE')
res = Net::HTTP.get_response(uri)
puts "Ping status: #{res.code}"
Python
import requests

resp = requests.get("https://pulsebeacon.io/ping/YOUR_CHECK_CODE", timeout=10)
resp.raise_for_status()

Troubleshooting

  • Missed/late alerts: verify scheduler/cron is running and job exit code is zero before ping.
  • No runtime shown: send ?rt=123 or ?runtime_ms=123.
  • 422 response: endpoint only accepts heartbeat checks (not HTTP/SSL/Port/Keyword monitors).
  • If you rotate a monitor code, update the ping URL in your job immediately.