Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (24 sloc) 1019 Bytes
# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See for complete details.
# This is the initialization for the New Relic Ruby Agent when used as
# a plugin
require 'new_relic/control'
# If you are having problems seeing data, be sure and check the
# newrelic_agent.log files in the log directory of your application
# If you can't find any log files and you don't see anything in your
# application log files please visit
# Initializer for the NewRelic Ruby Agent
# After verison 2.0 of Rails we can access the configuration directly.
# We need it to add dev mode routes after initialization finished.
current_config = if defined?(config)
elsif defined?(Rails.configuration)
NewRelic::Control.instance.init_plugin :config => current_config
rescue => e
::NewRelic::Agent.logger.error "Error initializing New Relic plugin. Agent is disabled.", e