Skip to content

feat(crons): Monitor GoodJob cron entries - #3147

Draft
wedamija wants to merge 3 commits into
masterfrom
danf/good-job-crons
Draft

wedamija wants to merge 3 commits into
masterfrom
danf/good-job-crons

Conversation

@wedamija

@wedamija wedamija commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Part of a series adding automatic Crons monitoring for the most-used job schedulers in each SDK. Check-ins for a monitor that doesn't exist yet are dropped, so today each monitor has to be created by hand with its schedule copied from the code. Sending the job's schedule as the monitor config lets Sentry create the monitor and keep it in sync.

This adds a :good_job_cron patch to sentry-rails that sends check-ins for every GoodJob cron entry in config.good_job.cron. Each cron key becomes a monitor slug, and the entry's cron and time zone are sent as the monitor config. The check-ins wrap each run on the worker, retries included.

config.enabled_patches << :good_job_cron
config.rails.good_job_exclude_cron_jobs = ["clear_cache", /^tmp_/]

Schedules Crons can't express, like every 10 seconds, and entries whose cron is a proc check in without a config. Jobs that already use sentry_monitor_check_ins are left alone.

The patch is off by default. good_job is added as a dev dependency for the specs (Rails 6.1+, Ruby 3.0+).

Based on #2751 by @amkisko.

Stacked on #3141.

@wedamija wedamija changed the title feat(crons): Add GoodJob cron monitoring feat(crons): Monitor GoodJob cron entries Oct 20, 2026
Base automatically changed from danf/cron-fugit-config to master October 21, 2026 14:23
@wedamija
wedamija force-pushed the danf/good-job-crons branch from 294957d to 1a4ef34 Compare October 21, 2026 16:12
@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown

RUBY-236

wedamija and others added 3 commits October 21, 2026 14:40
Sends check-ins for GoodJob cron entries when the :good_job_cron patch
is enabled, using the cron key as the slug and the entry's schedule as
the monitor config. Keys can be skipped with
config.rails.good_job_exclude_cron_jobs.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@wedamija
wedamija force-pushed the danf/good-job-crons branch from 1a4ef34 to 2fb94f3 Compare October 21, 2026 21:43
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