Sha256: 9d6532981a6d7bc596194f65c70b2f3c0c88125b628609e68948e39b5ed35185

Contents?: true

Size: 1.46 KB

Versions: 24

Compression:

Stored size: 1.46 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

# == New Relic Initialization
#
# When installed as a gem, you can activate the New Relic agent one of the following ways:
#
# For applications using Bundler, add this to the Gemfile:
#    gem 'newrelic_rpm'
#
# You will also need to install the newrelic.yml configuration file
#
# For applications not using Bundler, and for other installation information, visit:
# https://docs.newrelic.com/docs/agents/ruby-agent/installation/install-new-relic-ruby-agent/
#

require 'new_relic/control'

if defined?(Rails::VERSION)
  module NewRelic
    class Railtie < Rails::Railtie
      if ENV['NEW_RELIC_DEFER_RAILS_INITIALIZATION']
        initializer 'newrelic_rpm.include_method_tracers', before: :load_config_initializers do |app|
          Module.send(:include, NewRelic::Agent::MethodTracer::ClassMethods)
          Module.send(:include, NewRelic::Agent::MethodTracer)
        end

        initializer 'newrelic_rpm.start_plugin', after: :load_config_initializers do |app|
          NewRelic::Control.instance.init_plugin(config: app.config)
        end
      else
        initializer 'newrelic_rpm.start_plugin', before: :load_config_initializers do |app|
          NewRelic::Control.instance.init_plugin(config: app.config)
        end
      end
    end
  end
else
  NewRelic::Control.instance.init_plugin
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
newrelic_rpm-9.16.0 lib/newrelic_rpm.rb
newrelic_rpm-9.15.0 lib/newrelic_rpm.rb
newrelic_rpm-9.14.0 lib/newrelic_rpm.rb
newrelic_rpm-9.13.0 lib/newrelic_rpm.rb
newrelic_rpm-9.12.0 lib/newrelic_rpm.rb
newrelic_rpm-9.11.0 lib/newrelic_rpm.rb
newrelic_rpm-9.10.2 lib/newrelic_rpm.rb
newrelic_rpm-9.10.1 lib/newrelic_rpm.rb
newrelic_rpm-9.10.0 lib/newrelic_rpm.rb
newrelic_rpm-9.9.0 lib/newrelic_rpm.rb
newrelic_rpm-9.8.0 lib/newrelic_rpm.rb
newrelic_rpm-9.7.1 lib/newrelic_rpm.rb
newrelic_rpm-9.7.0 lib/newrelic_rpm.rb
newrelic_rpm-9.6.0 lib/newrelic_rpm.rb
newrelic_rpm-9.5.0 lib/newrelic_rpm.rb
newrelic_rpm-9.4.2 lib/newrelic_rpm.rb
newrelic_rpm-9.4.1 lib/newrelic_rpm.rb
newrelic_rpm-9.4.0 lib/newrelic_rpm.rb
newrelic_rpm-9.3.1 lib/newrelic_rpm.rb
newrelic_rpm-9.3.0 lib/newrelic_rpm.rb