DelayedJob Integration

How to configure rollbar-gem to work with DelayedJob

Add the following in config/initializers/rollbar.rb:

config.use_delayed_job

By default, an unnamed queue is used for processing jobs. If you wish to use a named queue, as
described here, pass the name of the queue as an option in the configuraton:

config.use_delayed_job :queue => 'my_queue'

If delayed_job is defined, Rollbar will automatically install a plugin that reports any uncaught exceptions that occur in jobs.

By default, the job's data will be included in the report. If you want to disable this functionality to prevent sensitive data from possibly being sent, use the following configuration option:

config.report_dj_data = false # default is true

You can also change the threshold of job retries that must occur before a job is reported to Rollbar:

config.dj_threshold = 2 # default is 0

If you use custom jobs that define their own hooks to report exceptions, please consider disabling our plugin. Not doing so will result in duplicate exceptions being reported as well as lack of control when exceptions should be reported. To disable our Delayed::Job plugin, add the following line after the Rollbar.configure block.

config.delayed_job_enabled = false

Only versions >= 3.0 of delayed_job are supported.

📘

For more information on rollbar-gem, please see the docs here.


Did this page help you?