Repository navigation
Conversation
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. Co-Authored-By: Claude <noreply@anthropic.com>
Run the job unmonitored when building the monitor fails, name method handlers after their owner and method, skip unnamed blocks with a log asking for name:, send only IANA time zones, and keep the first 50 characters of long slugs. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an opt-in
:rufus_schedulerpatch that sends Crons check-ins around rufus-scheduler jobs:in_progressbefore the block, thenokorerrorwith the duration. Errors are still handed to rufus'son_error.cronandeveryjobs send their schedule as the monitor config, so Sentry creates the monitor or updates its schedule. When Sentry would read a schedule differently (fugit-only cron syntax, aneverythat isn't whole minutes,intervaljobs, which wait after each run), check-ins go out without a config rather than with a schedule that would cause false missed-check-in alerts. One-offin/atjobs aren't monitored.The slug comes from the
name:option, or the handler's class or method; job ids are random per process. Unnamed blocks aren't monitored, andsentry_monitor: falseskips a job. sidekiq-scheduler jobs are left to:sidekiq_scheduler.Motivation
Check-ins for a monitor that doesn't exist yet are dropped, so rufus-scheduler users have to create each monitor by hand and add check-ins to every job. The schedule is already in the code, so the SDK can send it and monitors are created and kept in sync automatically.
Testing
spec/sentry/rufus_scheduler_spec.rb. The lockfiles addrufus-schedulerfor the specs.Docs: getsentry/sentry-docs#19789