Cron Jobs
Scheduled tasks are critical in automation workflows. Seiri ensures complete observability for cron-based jobs.
Monitoring Cron Jobs
- Integrate a heartbeat POST/GET at the start or completion of the job.
- Seiri logs each execution as an event.
- 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();