Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: 3.0.0_dev
Fetching contributors…

Cannot retrieve contributors at this time

file 37 lines (29 sloc) 1.317 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
# This is the initialization for the RPM Rails plugin
require 'new_relic/control'

# If you are having problems seeing data, be sure and check the
# newrelic_agent log files.
#
# If you can't find any log files and you don't see anything in your
# application log files, try uncommenting the two lines at the
# bottom of this file to verify the plugin is being loaded,
# then send the output to support@newrelic.com if you are unable to
# resolve the issue.

# Initializer for the NewRelic Agent

# After verison 2.0 of Rails we can access the configuration directly.
# We need it to add dev mode routes after initialization finished.

begin

  current_config = if defined?(config)
    config
  elsif defined?(Rails.configuration)
    Rails.configuration
  end

  NewRelic::Control.instance.init_plugin :config => current_config

rescue => e
  NewRelic::Control.instance.log! "Error initializing New Relic plugin (#{e})", :error
  NewRelic::Control.instance.log! e.backtrace.join("\n"), :error
  NewRelic::Control.instance.log! "Agent is disabled."
end

#ClassLoadingWatcher.flag_const_missing = nil
#
# ::RAILS_DEFAULT_LOGGER.warn "RPM detected environment: #{NewRelic::Control.instance.local_env.to_s}, RAILS_ENV: #{RAILS_ENV}"
# ::RAILS_DEFAULT_LOGGER.warn "Enabled? #{NewRelic::Control.instance.agent_enabled?}"
Something went wrong with that request. Please try again.