Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: v2_8_3
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (27 sloc) 1.345 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 support@newrelic.com
# if you are unable to resolve the issue.
# STDOUT.puts "RPM detected environment: #{NewRelic::LocalEnvironment.new}, RAILS_ENV: #{RAILS_ENV}"
# Initializer for the NewRelic Agent
require 'new_relic/config'
begin
# 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)
else
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")}"
end
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."
end
Jump to Line
Something went wrong with that request. Please try again.