Skip to content

fix(crons): Log debug message when monitor config interval unit is invalid - #3092

Open
chiliec wants to merge 1 commit into
getsentry:masterfrom
chiliec:fix/log-invalid-monitor-interval-unit
Open

chiliec wants to merge 1 commit into
getsentry:masterfrom
chiliec:fix/log-invalid-monitor-interval-unit

Conversation

@chiliec

@chiliec chiliec commented Sep 23, 2026

Copy link
Copy Markdown

Description

Sentry::Cron::MonitorConfig.from_interval silently returns nil when given an unknown unit (e.g. :minutes instead of :minute), so the check-in is sent without a monitor config and there's no hint why. Per the discussion in #2117, this now emits a debug log through the SDK logger (no raise) listing the valid units, and still returns nil.

Tests

Added to spec/sentry/cron/monitor_config_spec.rb:

  • logs a debug message for an invalid unit (fails without the change, passes with it)
  • still returns nil when the SDK is not initialized

Locally, on Ruby 3.3.6:

  • bundle exec rspec spec/sentry/cron/: 42 examples, 0 failures
  • BUNDLE_GEMFILE=Gemfile.rubocop bundle exec rubocop on the changed files: no offenses
  • full sentry-ruby suite: the only failures are the Redis specs (no Redis server on my machine) and one GraphQL spec that also fails on master

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.

Log when capture_checkin has bad arguments

1 participant