Sha256: afdfd40153a4ad0efedcd40a6009e950fe310b22ced513d00a9f6ca4b86ccb67

Contents?: true

Size: 886 Bytes

Versions: 7

Compression:

Stored size: 886 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
require 'new_relic/agent/instrumentation/action_controller_subscriber'


DependencyDetection.defer do
  @name = :rails5_controller

  depends_on do
    defined?(::Rails) && ::Rails::VERSION::MAJOR.to_i == 5
  end

  depends_on do
    defined?(ActionController) && (defined?(ActionController::Base) || defined?(ActionController::API))
  end

  executes do
    ::NewRelic::Agent.logger.info 'Installing Rails 5 Controller instrumentation'
  end

  executes do
    ActiveSupport.on_load(:action_controller) do |c|
      c.include NewRelic::Agent::Instrumentation::ControllerInstrumentation
    end

    NewRelic::Agent::Instrumentation::ActionControllerSubscriber \
      .subscribe(/^process_action.action_controller$/)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-4.4.0.336 lib/new_relic/agent/instrumentation/rails5/action_controller.rb
newrelic_rpm-4.3.0.335 lib/new_relic/agent/instrumentation/rails5/action_controller.rb
newrelic_rpm-4.2.0.334 lib/new_relic/agent/instrumentation/rails5/action_controller.rb
newrelic_rpm-4.1.0.333 lib/new_relic/agent/instrumentation/rails5/action_controller.rb
newrelic_rpm-4.0.0.332 lib/new_relic/agent/instrumentation/rails5/action_controller.rb
newrelic_rpm-3.18.1.330 lib/new_relic/agent/instrumentation/rails5/action_controller.rb
newrelic_rpm-3.18.0.329 lib/new_relic/agent/instrumentation/rails5/action_controller.rb