Skip to main content

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 statuses: Monitor health:

Check-in

A single job execution report:
Check-in statuses:

Schedule Types

Ping-Based Monitoring

For shell scripts and simple integrations:

Simple Ping URLs

Shell Script Integration

SDK-Based Monitoring

For application code:

Rust SDK

TypeScript SDK

Creating Monitors

Create via API:
Response:

Cron Expressions

Standard 5-field format:
Examples:

Grace Period & Timeouts

Grace Period

The checkin_margin_minutes provides tolerance:

Timeout Detection

If max_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:
Events:
  • checkin.started - Job started
  • checkin.ok - Job completed successfully
  • checkin.error - Job failed
  • monitor.missed - Expected check-in didn’t arrive
  • monitor.timeout - Job exceeded max_runtime
  • monitor.healthy - Monitor recovered from failure

Statistics

Get monitor stats:
Response:

Best Practices

Set Grace Periods

Use checkin_margin_minutes to avoid false alerts for jobs that vary slightly in timing

Monitor Timeouts

Set max_runtime_minutes to detect hung jobs

Environment Filters

Use environments to only monitor production runs

Capture 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