Sha256: d3b2c99f8e84422a27cf16a36dec8c3547f1478a549c2bf4a6437230a6be9795

Contents?: true

Size: 1.07 KB

Versions: 17

Compression:

Stored size: 1.07 KB

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

module NewRelic::Agent::Instrumentation
  module Resque
    include NewRelic::Agent::Instrumentation::ControllerInstrumentation

    def with_tracing
      begin
        perform_action_with_newrelic_trace(
          :name => 'perform',
          :class_name => self.payload_class,
          :category => 'OtherTransaction/ResqueJob'
        ) do
          NewRelic::Agent::Transaction.merge_untrusted_agent_attributes(
            args,
            :'job.resque.args',
            NewRelic::Agent::AttributeFilter::DST_NONE
          )

          yield
        end
      ensure
        # Stopping the event loop before flushing the pipe.
        # The goal is to avoid conflict during write.
        if NewRelic::Agent::Instrumentation::Resque::Helper.resque_fork_per_job?
          NewRelic::Agent.agent.stop_event_loop
          NewRelic::Agent.agent.flush_pipe_data
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
newrelic_rpm-9.4.2 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-9.4.1 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-9.4.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-9.3.1 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-9.3.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-9.2.2 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-9.2.1 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-9.2.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-9.1.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-9.0.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-8.16.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-8.15.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-8.14.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-8.13.1 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-8.13.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-8.12.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb
newrelic_rpm-8.11.0 lib/new_relic/agent/instrumentation/resque/instrumentation.rb