๐ 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.
๐ฏ What It Doesโ
- 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
โ๏ธ Configurationโ
| Setting | Description | Example |
|---|---|---|
| Name | What this heartbeat monitors | Nightly Backup |
| Label | Address field serves as a label | backup-cron |
| Check Interval | How often you expect a ping | 5 minutes |
| Grace Period | Extra time before marking down | 60 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.
๐ Usage Examplesโ
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.
๐ก Tipsโ
- 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