Cron job monitoring
Your job sends an HTTP request when it starts and when it ends. Pulsian pairs the two, keeps the Duration, and fails the run that is missed, runs too long or exits with anything but 0.
15 days of the Team Plan, without a card.
One line in the crontab
The request goes out only when the job succeeds. A job that does not run, or stops before the end, sends nothing, and the run fails as missed once its Grace Period has passed.
URL=https://heartbeat.pulsian.app/<token>
# m h dom mon dow command
30 2 * * * backup.sh && curl -fsS --retry 3 $URLEach run, start to end
Every Probe takes every Heartbeat, so a run’s start and its end may reach different Regions. The Hub pairs them into one run with its Duration.
A heartbeat Monitor page: its runs with their Duration and its Events.
Ways to report a run
Start with one line. Add the start, the exit code, the steps and a body when you want to know more.
backup.sh && curl -fsS --retry 3 $URLcurl -fsS --retry 3 $URL/start
backup.sh
curl -fsS --retry 3 $URL/$?RUN_ID=$(date +%s)
curl -fsS "$URL/start?run_id=$RUN_ID"
dump_database
curl -fsS -d "Dumped" "$URL/log?run_id=$RUN_ID"
upload_dump; EXIT_CODE=$?
curl -fsS "$URL/$EXIT_CODE?run_id=$RUN_ID"curl -fsS -d '{"rows": 1520}' $URL
# Assertion on the Check:
# json rows greater_than 0Reasons a run fails
Missed
No run ended within the Grace Period after its due time.
Ran too long
A started run did not end within its Maximum Duration.
Exit code
The end Heartbeat carried an exit code other than 0.
Reported failure
The job called the fail URL itself.
Assertion
The job ended well, but the body it sent broke one of your Assertions.
An outage of ours is not your job’s
If a Probe loses the Hub, it keeps answering and forwards the Heartbeats later.
A deadline counts only when our intake was up from the due time to the deadline. If it was not, the Check turns unknown. No one is told that a job failed.
Schedule settings
- Heartbeat Schedule
- An Interval, or a 5-field cron expression
- Time zone
- Any IANA zone, UTC by default
- Interval
- 1 minute to 365 days
- Grace Period
- 1 minute to 7 days, 1 hour by default
- Maximum Duration
- 1 second to 7 days; the Grace Period when unset
- Methods
- GET, HEAD or POST, on any HTTP client
- Body kept
- 10 KiB of text per run, all its steps together
- run_id
- 1 to 64 letters, digits, underscores or hyphens
Limits
- Nothing is installed on your host, so Pulsian cannot start, stop or retry a job.
- A cron expression must name a time at least once a year.
- Log output past 10 KiB per run is cut. Keep full logs where they are.
- The URL holds the Check’s token. Anyone who has it can send Heartbeats; rotate it if it leaks, and the old one answers 404.
Questions
Two runs overlap. Does the pairing break?
Send the same run_id on a run’s start and end. Without one, an end pairs with the newest open start that sent none.
Can the request slow my job down?
The Probe answers as soon as it has read the request, before the Hub hears of it. curl’s --retry 3 covers a network glitch.
A paused Monitor: will my job start logging errors?
No. A paused Check’s Heartbeats are answered 200 and dropped.
Put one curl on one line.
15 days of the Team Plan, without a card.