Skip to content

feat(crons): Add Solid Queue recurring task monitoring - #3140

Open
wedamija wants to merge 4 commits into
danf/cron-fugit-configfrom
danf/solid-queue-crons
Open

wedamija wants to merge 4 commits into
danf/cron-fugit-configfrom
danf/solid-queue-crons

Conversation

@wedamija

@wedamija wedamija commented Oct 16, 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.

Solid Queue is the default queue in Rails 8. This adds an opt-in patch for its recurring tasks (config/recurring.yml and dynamic tasks):

config.enabled_patches << :solid_queue_recurring
config.rails.solid_queue_exclude_recurring_tasks = ["clear_cache", /^tmp_/]

Tasks in solid_queue_exclude_recurring_tasks are skipped; strings match the task key, regexps are matched against it.

Each run sends in-progress and ok/error check-ins, with the task key as the slug and the task's schedule as the monitor config.

  • The slug comes from the task, not the job class, so one job class behind several tasks gets one monitor per task.
  • When the scheduler enqueues a task, the slug and schedule go into the job payload. The worker sends the check-ins from an around_perform, so there are no extra queries and retries check in too.
  • The time zone matches Solid Queue's: the zone in the schedule, then SolidQueue.time_zone, then the local zone.
  • Jobs that already call sentry_monitor_check_ins are left alone.

Stacked on #3141.
Docs: getsentry/sentry-docs#20047

Opt-in via `config.enabled_patches << :solid_queue_recurring`. Each
recurring task run sends in_progress/ok/error check-ins with the task
key as the slug and its schedule as the monitor config, built with
Sentry::Cron::FugitSchedule. Jobs whose class already configured
sentry_monitor_check_ins are skipped, matched by the task's job class.

Co-Authored-By: Claude <noreply@anthropic.com>
@wedamija
wedamija force-pushed the danf/solid-queue-crons branch from 7daefe7 to 47d6800 Compare October 16, 2026 17:02
Base automatically changed from danf/cron-fugit-config to danf/rufus-scheduler-crons October 16, 2026 17:02
@wedamija
wedamija changed the base branch from danf/rufus-scheduler-crons to danf/cron-fugit-config October 16, 2026 17:03
wedamija and others added 3 commits October 16, 2026 16:05
Co-Authored-By: Claude <noreply@anthropic.com>
…case

L schedules now convert to Crons schedules on the base branch.

Co-Authored-By: Claude <noreply@anthropic.com>
excluded? runs inside RecurringTask#enqueue, so a nil or broken
solid_queue_exclude_recurring_tasks raised and stopped every recurring
task from enqueuing. Wrap the value in Array and log any error instead.

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