Skip to content

feat(crons): Add rufus-scheduler cron monitoring - #3110

Open
wedamija wants to merge 5 commits into
danf/cron-fugit-configfrom
danf/rufus-scheduler-crons
Open

wedamija wants to merge 5 commits into
danf/cron-fugit-configfrom
danf/rufus-scheduler-crons

Conversation

@wedamija

@wedamija wedamija commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Part of a series that sends Crons monitor configs from Ruby schedulers. Check-ins for a monitor that does not exist yet are dropped, so today every monitor has to be created by hand with its schedule copied from the code. Sending the schedule lets Sentry create the monitor and keep it in sync.

This adds an opt-in patch for rufus-scheduler:

config.enabled_patches << :rufus_scheduler

cron and every jobs send in-progress and ok/error check-ins, with the job's schedule as the monitor config.

  • The slug is the job's name:, or the handler's class or method. Unnamed blocks aren't monitored, and sentry_monitor: false opts a job out.
  • interval jobs and schedules Sentry can't represent check in without a config. One-off in and at jobs aren't monitored.
  • Errors still reach rufus's on_error.

Stacked on #3141. The lockfile changes only add rufus-scheduler as a dev dependency.

Docs: getsentry/sentry-docs#19789

Opt-in via `config.enabled_patches << :rufus_scheduler`. Sends
in_progress/ok/error check-ins for cron, every and interval jobs, with a
monitor config for cron and fixed-interval every jobs, built with
Sentry::Cron::FugitSchedule.

Jobs run unmonitored when building the monitor fails. Method handlers
are named after their owner and method, unnamed blocks are skipped with
a log asking for name:, and long slugs keep their first 50 characters.

Co-Authored-By: Claude <noreply@anthropic.com>
@wedamija
wedamija force-pushed the danf/rufus-scheduler-crons branch from d9306dd to 75667e8 Compare October 16, 2026 17:02
@wedamija
wedamija changed the base branch from master to danf/cron-fugit-config October 16, 2026 17:03
wedamija and others added 4 commits October 16, 2026 16:25
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Method handlers were slugged by the class that defines the method, so
subclasses sharing an inherited method, or classes sharing a mixin
method, collided on one monitor.

Co-Authored-By: Claude <noreply@anthropic.com>
Matches the sidekiq-cron and sidekiq-scheduler patches, so the patch
still applies when rufus-scheduler is loaded after Sentry.init.

Co-Authored-By: Claude <noreply@anthropic.com>
@wedamija
wedamija marked this pull request as ready for review October 16, 2026 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant