ingestlayer/recipes

Monitor cron-job health

Hear about the scheduled jobs that fail or run long — and only those — so a silent backup or a stalled sync becomes a message, not a surprise.

the event

Emit cron.finished once; route it anywhere below.

  • jobstringjob name
  • statusstringok | failed
  • duration_msnumber
  • expected_msnumbertypical runtime
  • exit_codenumber
emit cron.finished
import { ingest } from "@ingestlayer/sdk";

await ingest("cron.finished", {
  job:         "nightly-backup",
  status:      ok ? "ok" : "failed",
  duration_ms: Date.now() - startedAt,
  expected_ms: 120000,
  exit_code:   code,
});

send it to