Stay up to date on everything big and small, from product updates to SDK changes.
Version 7.3.0 of the Sentry Ruby SDK adds support for GoodJob, the Postgres-backed Active Job backend. GoodJob jobs now report errors and traces to Sentry, and their cron entries can be monitored with Crons with a single line of config.
GoodJob uses the Active Job integration in sentry-rails, so you don't need another gem. Set GoodJob as your queue adapter:
# config/application.rb
config.active_job.queue_adapter = :good_job
Each job then reports its errors to Sentry and sends a transaction for each run. The trace continues from the request or job that enqueued it, so you can follow a slow checkout from the web request into the job that sent the receipt. Spans include the queue name, job ID, and good_job as the messaging system.
A cron job that stops running doesn't raise an error. You usually find out when someone asks where the nightly report went. If you schedule jobs with GoodJob's cron, one line puts every entry under Crons monitoring, with no changes to your job classes:
Sentry.init do |config|
config.enabled_patches << :good_job_cron
# Optional: skip entries you don't want to monitor
config.rails.good_job_exclude_cron_jobs = [:clear_cache, /\Atmp_/]
end
Sentry creates a monitor from each entry's key, schedule, and time zone. Each run, including retries, sends check-ins, so Sentry alerts you when a job fails, runs too long, or doesn't start on time. Entries with schedules that Crons can't represent, such as every 10 seconds, are skipped. Cron monitoring requires GoodJob 4.0 or later. See Crons setup for GoodJob.
When errors spike after a rollout, the first question is which flag caused it. Record each flag your app evaluates:
Sentry.add_feature_flag("new-checkout", true)
Each error then lists the flags evaluated before it, and spans record them too. You can tell at a glance whether the errors only happen with new-checkout on, and turn it off. See Feature Flags.
A job can succeed and still be late, because it sat in the queue for minutes before a worker picked it up. Active Job jobs, including GoodJob, and Sidekiq and Resque jobs now report how long they waited and how large their payload was. The Queues dashboard shows this, so you can see when your workers can't keep up before your users do.
Sentry.logger accepts block syntax, so you can pass it to libraries that log with blocks, such as Faraday's logging middleware.AUTH and admin commands.sentry-rails instead of their own integration. This is opt-in; current behavior doesn't change.See the release notes for all changes.