Sha256: dbcc6478cab43278cf1fa03672b69d9c221604affa0af33e5688a30abfbd43f5

Contents?: true

Size: 457 Bytes

Versions: 5

Compression:

Stored size: 457 Bytes

Contents

module Sentry
  module Sidekiq
    class CleanupMiddleware
      def call(_worker, job, queue)
        Sentry.clone_hub_to_current_thread
        Sentry.with_scope do |scope|
          scope.set_extras(sidekiq: job.merge("queue" => queue))
          scope.set_transaction_name("Sidekiq/#{job["class"]}")

          begin
            yield
          rescue => ex
            Sentry.capture_exception(ex)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sentry-sidekiq-4.0.0 lib/sentry/sidekiq/cleanup_middleware.rb
sentry-sidekiq-0.2.0 lib/sentry/sidekiq/cleanup_middleware.rb
sentry-sidekiq-0.1.3 lib/sentry/sidekiq/cleanup_middleware.rb
sentry-sidekiq-0.1.2 lib/sentry/sidekiq/cleanup_middleware.rb
sentry-sidekiq-0.1.1 lib/sentry/sidekiq/cleanup_middleware.rb