Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (26 sloc) 1.26 KB
# This is the initialization for the RPM Rails plugin
# 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 these lines to verify
# the plugin is being loaded, then contact
# if you are unable to resolve the issue.
# STDOUT.puts "RPM detected environment: #{}"
# Initializer for the NewRelic Agent
# JRuby's glassfish plugin is trying to run the Initializer twice,
# which isn't a good thing so we ignore subsequent invocations here.
if ! defined?(::NEWRELIC_STARTED)
::NEWRELIC_STARTED = "#{caller.join("\n")}"
NewRelic::Config.instance.start_plugin (defined?(config) ? config : nil)
NewRelic::Config.instance.log.debug "Attempt to initialize the plugin twice!"
NewRelic::Config.instance.log.debug "Original call: \n#{::NEWRELIC_STARTED}"
NewRelic::Config.instance.log.debug "Here we are now: \n#{caller.join("\n")}"
rescue => e
NewRelic::Config.instance.log! "Error initializing New Relic plugin (#{e})", :error
NewRelic::Config.instance.log! e.backtrace.join("\n"), :error
NewRelic::Config.instance.log! "Agent is disabled."
Something went wrong with that request. Please try again.