Overview
Loom’s cron monitoring system tracks scheduled jobs, background tasks, and cron jobs to detect missed runs, failures, and performance degradation. Supports both simple ping-based monitoring (like Healthchecks.io) and SDK-based check-ins (like Sentry Crons).Cron monitoring integrates with crash tracking to link failed check-ins to crash events.
Key Features
- Dual integration: Simple HTTP pings for shell scripts, SDK for application code
- Missed run detection with configurable grace periods
- Timeout detection for long-running jobs
- Schedule support for cron expressions and fixed intervals
- Real-time alerts via SSE streaming
Core Concepts
Monitor
A monitored job or scheduled task:
Monitor health:
Check-in
A single job execution report:Schedule Types
Ping-Based Monitoring
For shell scripts and simple integrations:Simple Ping URLs
Shell Script Integration
- Simple
- With Error Handling
- Kubernetes CronJob
SDK-Based Monitoring
For application code:Rust SDK
TypeScript SDK
Creating Monitors
Create via API:Cron Expressions
Standard 5-field format:Grace Period & Timeouts
Grace Period
Thecheckin_margin_minutes provides tolerance:
Timeout Detection
Ifmax_runtime_minutes is set, jobs exceeding this are marked as timeout:
API Endpoints
Ping Endpoints (No Auth)
endpoint
Success ping
endpoint
Job startingResponse:
endpoint
Job failedQuery Parameters:
exit_code- Exit code (optional)
endpoint
Ping with output bodyBody: Plain text output (max 10KB)
Monitor Management
endpoint
List monitorsQuery Parameters:
status- Filter by status (active, paused, disabled)health- Filter by health (healthy, failing, missed)
endpoint
Create monitorRequest:
endpoint
Update monitor
endpoint
Pause monitoring (won’t alert on missed runs)
endpoint
Resume monitoring
Check-in Management
endpoint
Create check-in (SDK)Request:
endpoint
Update check-inRequest:
endpoint
List check-ins for monitorQuery Parameters:
limit- Max results (default: 100)status- Filter by status
Real-time Updates (SSE)
Subscribe to monitor events:checkin.started- Job startedcheckin.ok- Job completed successfullycheckin.error- Job failedmonitor.missed- Expected check-in didn’t arrivemonitor.timeout- Job exceeded max_runtimemonitor.healthy- Monitor recovered from failure
Statistics
Get monitor stats:Best Practices
Set Grace Periods
Use
checkin_margin_minutes to avoid false alerts for jobs that vary slightly in timingMonitor Timeouts
Set
max_runtime_minutes to detect hung jobsEnvironment Filters
Use
environments to only monitor production runsCapture Output
POST output to ping URLs for debugging failed runs
See Also
Crash Tracking
Link failed jobs to crash events
Analytics
Track job execution patterns
Sessions
Monitor job session health