Know before your customers
Canopus calls your addresses on a schedule, says when one stops answering and when it is back, warns before a certificate expires, and checks that your scheduled tasks ran on time. The alerts go to the same people and channels as the error alerts.
Uptime checks
Add an address on Customers, Uptime, or watch your site and app addresses in one click. A check is a GET or HEAD with a 10 second limit; a good answer is the status you asked for (any 2xx by default) and, for a GET, the text you asked for. A site is down after two failed checks in a row, never one, and back at the first good check. The certificate is read twice a day: you are warned 14 days, then 3 days, before it expires.
Checks leave from a single region, in the European Union. Addresses inside a private network are refused.
| Plan | Addresses | Checked every | Scheduled tasks |
|---|---|---|---|
| Starter | 2 | 5 minutes | 2 |
| Growth | 5 | minute | 10 |
| Scale | 20 | minute | 50 |
Scheduled tasks
A task tells Canopus it ran: in_progress when it starts and ok or error when it ends, with the same checkinId, or a single ok at the end. Its schedule is a crontab line read in its timezone, or an interval counted from the last beat. It is missed when no beat came by its due time plus its margin, and overrun when a run that started has not ended within its longest run. You are told once, then again when it works.
A task can be declared on Customers, Uptime, or by its first beat: with a schedule, it is watched at once; without one, it waits paused until a beat brings one. The key is the one of your errors, scope "Send errors".
curl -X POST https://www.canopushq.io/api/v1/monitors/nightly-export/checkins \
-H "Authorization: Bearer $CANOPUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "ok", "schedule": {"crontab": "0 3 * * *"}, "timezone": "Europe/Paris"}'// Node, without an SDK: start, then end with the same checkinId
const url = 'https://www.canopushq.io/api/v1/monitors/nightly-export/checkins'
const headers = {
authorization: `Bearer ${process.env.CANOPUS_API_KEY}`,
'content-type': 'application/json',
}
const checkinId = crypto.randomUUID()
await fetch(url, { method: 'POST', headers, body: JSON.stringify({ status: 'in_progress', checkinId }) })
try {
await runExport()
await fetch(url, { method: 'POST', headers, body: JSON.stringify({ status: 'ok', checkinId }) })
} catch (error) {
await fetch(url, { method: 'POST', headers, body: JSON.stringify({ status: 'error', checkinId }) })
throw error
}# Python, with the Sentry SDK pointed at your Canopus DSN
from sentry_sdk.crons import monitor
@monitor(monitor_slug="nightly-export", monitor_config={
"schedule": {"type": "crontab", "value": "0 3 * * *"},
"timezone": "Europe/Paris", "checkin_margin": 5, "max_runtime": 30,
})
def nightly_export():
...- status *
- in_progress, ok or error.
- checkinId
- The run’s id, the same on its start and its end. A retried beat counts once.
- duration
- Seconds the run took.
- schedule
- { "crontab": "0 3 * * *" } or { "interval": { "value": 6, "unit": "hour" } }. Declares or updates the task.
- timezone
- An IANA name, such as Europe/Paris. UTC by default.
- marginMinutes, maxRuntimeMinutes
- How late a beat may be (5 by default) and the longest run (30 by default).