Zum Hauptinhalt springen

๐Ÿ’“ Heartbeat Monitor

The Heartbeat monitor is different from all other monitors โ€” it's passive. Instead of Monitron checking your service, your service sends a "ping" to Monitron at regular intervals. If a ping isn't received within the expected timeframe, Monitron knows something is wrong.


๐ŸŽฏ Was Es Machtโ€‹

  • Listens for incoming HTTP pings from your services
  • Each heartbeat monitor has a unique token URL
  • If no ping is received within the interval + grace period, marks as Down
  • Creates an incident automatically on failure

๐Ÿ”— How It Worksโ€‹

Your Service โ”€โ”€โ”€โ”€ HTTP GET/POST โ”€โ”€โ”€โ”€โ†’ Monitron
โ”‚
Every 5 minutes โ”‚
(your schedule) โ”œโ”€โ”€ Ping received? โœ… Up
โ”‚
If no ping for โ”‚
interval + grace โ”€โ”€โ†’ โ”œโ”€โ”€ No ping? โŒ Down

โš™๏ธ Konfigurationโ€‹

EinstellungBeschreibungBeispiel
NameWhat this heartbeat monitorsNightly Backup
LabelAddress field serves as a labelbackup-cron
Check IntervalHow often you expect a ping5 minutes
Grace PeriodExtra time before marking down60 seconds

๐Ÿ”— Your Heartbeat URLโ€‹

After creating a heartbeat monitor, Monitron generates a unique URL:

https://your-monitron.com/heartbeat/abc123def456

Send a GET or POST request to this URL from your service.


๐Ÿ“– Anwendungsbeispieleโ€‹

See the Heartbeat Monitoring section for detailed integration examples with cron jobs, Laravel, Node.js, Python, and more.


โš ๏ธ Failure Endpointโ€‹

To explicitly report a failure, send a POST to:

https://your-monitron.com/heartbeat/abc123def456/fail

This immediately marks the monitor as Down and creates an incident, even if the regular interval hasn't expired yet.


๐Ÿ’ก Tippsโ€‹

  • Always add a grace period! Network delays, slow cron starts, or slight timing variations can cause false alerts. A 60-second grace period handles this.
  • Use the failure endpoint in your error handling:
    my-backup-script.sh || curl https://your-monitron.com/heartbeat/TOKEN/fail