UI Setup

Create cron monitors in Sentry's interface, then add simple notification code to your app.

The UI Setup approach is a two-step process: first create your monitor definition in Sentry's interface (including alerts), then add simple notification code to your application.

Choose UI setup when you want:

  • Pre-configured alerts - monitor creation includes alert setup
  • Visual schedule management - update schedules without code changes
  • Simple integration - minimal code changes to existing cron jobs

  1. Navigate to Crons in your Sentry project
  2. Click Create Monitor
  3. Configure your settings:
    • Name: daily-report-generator
    • Schedule: 0 9 * * 1-5 (9 AM weekdays)
    • Timezone: America/New_York

Sentry automatically sets up alerts for missed and failed jobs.

After creating the monitor, add simple check-in calls to your cron job:

Copied
import * as Sentry from "@sentry/node";

async function runDailyReport() {
  // Notify Sentry the job started
  const checkInId = Sentry.captureCheckIn({
    monitorSlug: "daily-report-generator",
    status: "in_progress",
  });

  try {
    // Your existing job logic
    await generateReport();

    // Notify success
    Sentry.captureCheckIn({
      checkInId,
      monitorSlug: "daily-report-generator",
      status: "ok",
    });
  } catch (error) {
    // Notify failure
    Sentry.captureCheckIn({
      checkInId,
      monitorSlug: "daily-report-generator",
      status: "error",
    });
  }
}

  1. Run your cron job manually or wait for next execution
  2. Check Crons dashboard in Sentry to see the check-in
  3. Test alerts by skipping a scheduled run

Now that you understand the two-step process, choose the best instrumentation approach for your setup:

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").