Sha256: 7bd4eb38dfc3b2ad22b26c73304b52913dadd0fc564c1461807b4debfccec6e4

Contents?: true

Size: 1.63 KB

Versions: 6

Compression:

Stored size: 1.63 KB

Contents

module NewRelic
  module Agent
    module Instrumentation
      module Rails3
        module ActionController
          def self.newrelic_write_attr(attr_name, value) # :nodoc:
            write_inheritable_attribute(attr_name, value)
          end

          def self.newrelic_read_attr(attr_name) # :nodoc:
            read_inheritable_attribute(attr_name)
          end

          # determine the path that is used in the metric name for
          # the called controller action
          def newrelic_metric_path(action_name_override = nil)
            action_part = action_name_override || action_name
            if action_name_override || self.class.action_methods.include?(action_part)
              "#{self.class.controller_path}/#{action_part}"
            else
              "#{self.class.controller_path}/(other)"
            end
          end

          def process_action(*args)
            # skip instrumentation if we are in an ignored action
            if _is_filtered?('do_not_trace')
              NewRelic::Agent.disable_all_tracing do
                return super
              end
            end

            perform_action_with_newrelic_trace(:category => :controller, :name => self.action_name, :path => newrelic_metric_path, :params => request.filtered_parameters, :class_name => self.class.name)  do
              super
            end
          end

        end
      end
    end
  end
end

if defined?(ActionController) && defined?(ActionController::Base)
  class ActionController::Base
    include NewRelic::Agent::Instrumentation::ControllerInstrumentation
    include NewRelic::Agent::Instrumentation::Rails3::ActionController
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
newrelic_rpm-2.13.6.beta2 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.6.beta1 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.5.beta4 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.5.beta3 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.5.beta2 lib/new_relic/agent/instrumentation/rails3/action_controller.rb
newrelic_rpm-2.13.5.beta1 lib/new_relic/agent/instrumentation/rails3/action_controller.rb