Skip to content
Create an account

Jobs monitoring

Jobs monitoring #

Record every run of your cron jobs and background tasks. Your job reports when it starts and when it ends, with its exit code, its duration and an optional output tail, and Callisto alerts you when a run fails, runs too long or does not start on time.

A heartbeat only tells you "I am alive": one ping, and an alert if the next one is late. A job also keeps the history of its runs (start, end, duration, exit code, message) and can follow a cron schedule. A job is a heartbeat monitor underneath: it counts in the same quota and at the same price as a heartbeat.

Configuration

  1. Go to Jobs → New job.
  2. Give the job a name, such as "Nightly report".
  3. Optionally enter its cron schedule, for example 0 2 * * *, and its time zone.
  4. Set the grace period and, if you want an overrun alert, the maximum duration.
  5. Copy the URL it generates and call it from your job, as shown below.
Setting Description
Cron schedule Five fields: minute, hour, day, month, weekday. The job is late when no run or ping has arrived since its latest scheduled time plus the grace period. Without a schedule, the expected interval applies, like a heartbeat.
Time zone The IANA zone the schedule is read in. Defaults to your organization's time zone.
Grace period How long after the scheduled time a run may still start before the job is late. The minimum is 60 seconds.
Maximum duration A run still in progress after this long raises an overrun alert. Empty: no overrun alert.
Alert phone number Optional. Receives the alerts by SMS.
Alert webhook URL Optional. Callisto sends each alert to this URL.

The three events

Each run is reported with up to three requests to the ping URL of the job. Each accepts GET or POST.

https://ping.callistosignal.com/<uuid>/run
https://ping.callistosignal.com/<uuid>/complete
https://ping.callistosignal.com/<uuid>/fail
  • /run: the run starts. It is recorded as running. It also counts as a ping.
  • /complete: the run succeeded. It closes the run and counts as a ping. A non-zero exit_code sent here is recorded, but the run stays a success: report a failure with /fail.
  • /fail: the run failed. It closes the run, triggers a failure alert, and does not count as a ping: a failed run is not proof that the job is healthy.

Pairing: send the same run_key on /run and on /complete or /fail and the finish closes that run, whatever its age. If no open run has that key, the finish is recorded as a run of its own. Without a run_key, the finish closes the latest open run of the last 24 hours, or is recorded alone if there is none.

Parameters

All parameters are optional and are read from the query string, from a form body or from a JSON body. Values over a limit are cut or ignored; the request is never refused for them, so a long log tail still records the run.

Parameter Type Description
run_key string Identifier that pairs a run with its finish. 64 characters at most, cut beyond.
exit_code integer Exit code of the process, a 32-bit integer. Ignored otherwise.
duration_ms integer Duration in milliseconds, from 0 to 2147483647. Used only when no run is paired with the finish; otherwise Callisto measures the duration itself.
message string Output tail or error message. 8 KiB of UTF-8 at most, cut beyond.
metrics JSON object Small JSON object, such as {"rows": 1200}. 2 KiB at most once encoded; larger, it is dropped.
source string Where the run came from, such as the host name. 64 characters at most, cut beyond.

Send message and metrics in a POST body, never in the query string: query strings are written to access logs.

Response

{
"ok": true,
"monitor": "Nightly report",
"state": "succeeded",
"run_id": 1842
}

state is running, succeeded, failed. An unknown or malformed id returns 404. Past 60 requests a minute from the same IP address for the same job, the URL answers 429; the run events and the plain ping share this limit. run_id is null for a monitor that has no organization, and no run is stored.

Report a run from your job

#!/bin/sh
# /usr/local/bin/callisto-job: run a command and report it to Callisto.
# Usage: callisto-job command [args...]
BASE="https://ping.callistosignal.com/<uuid>"
RUN_KEY="$(date +%s)-$$"
SOURCE="$(hostname)"
LOG="$(mktemp)"

curl -fsS -m 10 --retry 3 -X POST "$BASE/run" \
--data-urlencode "run_key=$RUN_KEY" \
--data-urlencode "source=$SOURCE" >/dev/null || true

"$@" >"$LOG" 2>&1
CODE=$?

if [ "$CODE" -eq 0 ]; then
EVENT=complete
else
EVENT=fail
fi

curl -fsS -m 10 --retry 3 -X POST "$BASE/$EVENT" \
--data-urlencode "run_key=$RUN_KEY" \
--data-urlencode "source=$SOURCE" \
--data-urlencode "exit_code=$CODE" \
--data-urlencode "message=$(tail -c 4000 "$LOG")" >/dev/null || true

cat "$LOG"
rm -f "$LOG"
exit "$CODE"

# chmod +x /usr/local/bin/callisto-job, then in crontab -e:
# 0 2 * * * /usr/local/bin/callisto-job /usr/bin/php /var/www/app/artisan reports:nightly
# start
curl -fsS -m 10 --retry 3 -X POST "https://ping.callistosignal.com/<uuid>/run" \
--data-urlencode "run_key=nightly-2026-10-30"

# success
curl -fsS -m 10 --retry 3 -X POST "https://ping.callistosignal.com/<uuid>/complete" \
--data-urlencode "run_key=nightly-2026-10-30" \
--data-urlencode "exit_code=0" \
--data-urlencode 'metrics={"rows":1200,"errors":0}' \
--data-urlencode "message=Imported 1200 rows"

# failure
curl -fsS -m 10 --retry 3 -X POST "https://ping.callistosignal.com/<uuid>/fail" \
--data-urlencode "run_key=nightly-2026-10-30" \
--data-urlencode "exit_code=2" \
--data-urlencode "message=Connection refused by db-1"
import socket
import urllib.parse
import urllib.request
import uuid

PING = "https://ping.callistosignal.com/<uuid>"


def ping(event, **fields):
data = urllib.parse.urlencode(fields).encode()
try:
request = urllib.request.Request(f"{PING}/{event}", data=data)
urllib.request.urlopen(request, timeout=10).read()
except OSError:
pass  # monitoring must never break the job


def monitored(job):
run_key = uuid.uuid4().hex
source = socket.gethostname()
ping("run", run_key=run_key, source=source)
try:
job()
except Exception as exc:
message = f"{type(exc).__name__}: {exc}"[:4000]
ping("fail", run_key=run_key, source=source, exit_code=1, message=message)
raise
ping("complete", run_key=run_key, source=source)
import { randomUUID } from "node:crypto";
import os from "node:os";

const PING = "https://ping.callistosignal.com/<uuid>";

async function ping(event, fields) {
try {
await fetch(`${PING}/${event}`, {
method: "POST",
body: new URLSearchParams(fields),
signal: AbortSignal.timeout(10_000),
});
} catch (_) {
// monitoring must never break the job
}
}

export async function monitored(job) {
const runKey = randomUUID();
const source = os.hostname();
await ping("run", { run_key: runKey, source });
try {
await job();
} catch (err) {
const message = String(err?.stack ?? err).slice(0, 4000);
await ping("fail", { run_key: runKey, source, exit_code: "1", message });
throw err;
}
await ping("complete", { run_key: runKey, source });
}

The Get started page of Jobs in the dashboard has ready-made snippets, with your URLs filled in, for Linux cron, Kubernetes, Windows, Sidekiq, Celery, GitHub Actions, Airflow, Laravel, and for Python, JavaScript, Ruby, PHP, Go, Rust, .NET and Java.

Alerts

A job raises an alert in three cases:

  • Late: no run or ping since its latest scheduled time plus the grace period. A run already in progress within the maximum duration is not late.
  • Failed: the job reported /fail. The alert carries the exit code and the end of the message.
  • Overrun: a run is still in progress after the maximum duration. One alert per run; the job is not marked down, since it may still succeed.

Channels: an email is always sent. If you set a phone number, you also get an SMS, taken from your plan's SMS alerts first, then from your credits. If you set a webhook URL, each alert and each recovery is sent to it.

Recovery: when a run succeeds after a late or failed job, you get one recovery email.

The plain ping still works

GET https://ping.callistosignal.com/<uuid> still works on a job. It counts as a success with no run recorded.

Pricing: a job is billed like a heartbeat monitor, monthly per monitor. See the pricing.

A public API to manage jobs is on the way. For now, set them up in the dashboard.