Aller au contenu principal

💓 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.


🎯 Ce Qu'il Fait

  • 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

ParametreDescriptionExemple
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.


📖 Exemples d'Utilisation

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.


💡 Conseils

  • 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