Skip to main content

๐Ÿ“– 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

๐Ÿ”ง How It Worksโ€‹

  1. Create a Heartbeat monitor in Monitron
  2. You get a unique URL: https://your-monitron.com/heartbeat/{token}
  3. Add a ping at the end of your script/job
  4. Monitron expects a ping every interval seconds
  5. 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.


โš™๏ธ Configurationโ€‹

SettingDescriptionRecommendation
IntervalHow often you expect a pingMatch your cron schedule
Grace PeriodExtra time before alerting60 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