Skip to main content

Cron Jobs

Scheduled tasks are critical in automation workflows. Seiri ensures complete observability for cron-based jobs.


Monitoring Cron Jobs

  1. Integrate a heartbeat POST/GET at the start or completion of the job.
  2. Seiri logs each execution as an event.
  3. Configure alerts for:
    • Missed executions
    • Failures
    • Latency thresholds

Example (Node.js)

import fetch from 'node-fetch';

async function scheduledTask() {
// Task logic
await fetch('https://cloud.seiri.app/abcd:1234/success', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ status: 'success', timestamp: Date.now() })
});
}

scheduledTask();