📖 Heartbeat Monitoring Overview
Heartbeat monitoring is a passive monitoring approach. Instead of Monitron reaching out to check your service, your service sends a "ping" to Monitron at regular intervals. If the ping stops coming, Monitron knows something is wrong.
🎯 Perfect For
- ⏰ Cron jobs — Is my nightly backup actually running?
- 📋 Scheduled tasks — Did the daily report generation complete?
- 🔄 Background workers — Is my queue processor still alive?
- 📦 Batch processes — Did the data import finish?
- 🤖 Custom scripts — Anything that runs on a schedule
🔧 كيف يعمل
- Create a Heartbeat monitor in Monitron
- You get a unique URL:
https://your-monitron.com/heartbeat/{token} - Add a ping at the end of your script/job
- Monitron expects a ping every
intervalseconds - If no ping arrives within
interval + grace, Monitron marks it Down
🔗 Two Endpoints
✅ Success Ping
GET or POST https://your-monitron.com/heartbeat/{token}
Call this when your job completes successfully.
❌ Failure Report
POST https://your-monitron.com/heartbeat/{token}/fail
Call this when your job fails. This immediately creates an incident.
⚙️ التكوين
| الإعداد | الوصف | Recommendation |
|---|---|---|
| Interval | How often you expect a ping | Match your cron schedule |
| Grace Period | Extra time before alerting | 60 seconds minimum |
Example
If your cron runs every 5 minutes:
- Set Interval to
5 minutes - Set Grace Period to
60 seconds - Monitron will alert if no ping arrives within 6 minutes