Skip to content

Exceptions from ActiveJob with Resque backend are not captured on Sentry #1559

@tsrivishnu

Description

@tsrivishnu

Describe the bug

Exceptions from ActiveJob jobs are not sent to Sentry. The jobs simply fail and no errors are sent to Sentry.

image

I'm not sure if I'm missing any configuration options for this to work correctly.

To Reproduce

Rails.application.config.active_job.queue_adapter = :resque

class ApplicationJob < ActiveJob::Base
end

class MyJob < ApplicationJob
  def perform
    raise "foo"
  end
end

MyJob.perform_later
$ bundle exec rake environment resque:work QUEUE=*

Expected behavior

foo RuntimeError is captured and sent to Sentry

Actual behavior

foo RuntimeError is not captured and not sent to Sentry

Environment

  • Ruby Version: 2.7.1
  • SDK Version: 4.7.1
  • Integration Versions (if any):
    • Rails 6.1.3.2,
    • Resque 2.0.0,
    • sentry-rails 4.7.1

Sentry Config

Sentry.init do |config|
  config.dsn = "..."
  config.breadcrumbs_logger = [:active_support_logger, :http_logger]

  # Sent events only for the below environments
  config.enabled_environments = %w[ development staging production ]

  config.background_worker_threads = 0

  filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)
  config.before_send = lambda do |event, _hint|
    filter.filter(event.to_hash)
  end
end

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions