When to use it
- Cron jobs and scheduled tasks
- Backups
- ETL and data-sync pipelines
- Batch jobs and queue workers that should report in regularly
Create a heartbeat monitor
1
Create the monitor
Choose the Heartbeat type, then set how often your job runs (the expected interval) and how much lateness to tolerate (the grace period).
2
Copy the heartbeat URL
UptimeIO generates a unique URL for the monitor:The API builds the same URL on the
api.uptimeio.com host (https://api.uptimeio.com/heartbeat/{token}). Both hostnames reach the same endpoint and behave identically.3
Ping it from your job
Request the URL when the job finishes successfully.
Settings
The target and token are generated for you. You do not send a
target.
Example
Sending a heartbeat
The heartbeat URL needs no authentication: the token in the URL is the credential. SendGET or POST:
200:
Metadata (POST only)
Optionalmetadata object in the JSON body:
- Up to 10 keys; keys use letters, digits,
_and-(1 to 100 characters) - Values are strings (up to 500 characters), numbers or booleans
- About 2 KB in total; the request body is limited to 20 KB
400 INVALID_METADATA. A body that is not valid JSON is ignored and the ping is still recorded.
Rate limits
Exceeding a limit returns
429 RATE_LIMIT_EXCEEDED with a Retry-After header. A monitor rarely needs more than one ping per interval.
Errors
When incidents open and close
- Open: no ping arrives within the expected interval plus the grace period. Overdue monitors are checked every 30 seconds. With an interval of 1 hour and a grace period of 5 minutes, the incident opens after 65 minutes of silence.
- Resolve: after 3 consecutive on-time pings, which avoids false recoveries from an unstable job.
Integration examples
Best practices
- Ping only on success, so a failing job stops the pings and opens an incident.
- Match the interval to your schedule: hourly cron = 3,600 seconds, daily backup = 86,400.
- Size the grace period to the job’s runtime variation: a backup that takes 10 to 20 minutes needs about 30 minutes.
- Treat the URL as a secret. Anyone with it can send pings and hide real failures.
Troubleshooting
Incident opened but the job ran
Incident opened but the job ran
The ping may have failed or gone to the wrong URL, or it was sent before the job finished. Use
curl -fsS so errors are visible, confirm the URL, and ping at the end of the job.No incident when the job fails
No incident when the job fails
The job pings even on failure. Ping only after a successful run (check the exit code).
429 responses
429 responses
You are pinging more often than 3 times per 30 seconds (or, on Free, more than once per 120 seconds). Reduce the frequency.
404 INVALID_TOKEN
404 INVALID_TOKEN
No monitor uses this token. The monitor may have been deleted or its token replaced. Copy the current URL from the monitor.
INTERVAL_TOO_SHORT on create
INTERVAL_TOO_SHORT on create
The expected interval is below your plan minimum (Free 300 seconds).
Next steps
HTTP Monitoring
Monitor web services and APIs
Notifications
Configure alerts for heartbeat monitors