Sha256: 99b6e443e9b48bf04df8f850a11644976aefc3b0fb97e95720495ce1a53e6eb8

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module Appsignal
  module Integrations
    # @api private
    module ResqueActiveJobPlugin
      include Appsignal::Hooks::Helpers

      def self.included(base)
        base.class_eval do
          around_perform do |job, block|
            params = Appsignal::Utils::HashSanitizer.sanitize(
              job.arguments,
              Appsignal.config[:filter_parameters]
            )

            queue_start =
              if job.respond_to?(:enqueued_at) && job.enqueued_at
                Time.parse(job.enqueued_at).utc
              end

            Appsignal.monitor_single_transaction(
              "perform_job.resque",
              :class       => job.class.to_s,
              :method      => "perform",
              :params      => params,
              :queue_start => queue_start,
              :metadata    => {
                :id       => job.job_id,
                :queue    => job.queue_name
              }
            ) do
              block.call
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
appsignal-2.10.12 lib/appsignal/integrations/resque_active_job.rb
appsignal-2.10.12-java lib/appsignal/integrations/resque_active_job.rb
appsignal-2.10.11 lib/appsignal/integrations/resque_active_job.rb
appsignal-2.10.11-java lib/appsignal/integrations/resque_active_job.rb
appsignal-2.10.10 lib/appsignal/integrations/resque_active_job.rb
appsignal-2.10.10-java lib/appsignal/integrations/resque_active_job.rb
appsignal-2.10.9 lib/appsignal/integrations/resque_active_job.rb
appsignal-2.10.9-java lib/appsignal/integrations/resque_active_job.rb