| Module | NewRelic::Control::InstanceMethods |
| In: |
lib/new_relic/control/instance_methods.rb
|
Contains methods that relate to the runtime usage of the control object. Note that these are subject to override in the NewRelic::Control::Framework classes that are actually instantiated
| env | [W] | The env is the setting used to identify which section of the newrelic.yml to load. This defaults to a framework specific value, such as ENV[‘RAILS_ENV’] but can be overridden as long as you set it before calling init_plugin |
| local_env | [R] | The local environment contains all the information we report to the server about what kind of application this is, what gems and plugins it uses, and many other kinds of machine-dependent information useful in debugging |
Initialize the plugin/gem and start the agent. This does the necessary configuration based on the framework environment and determines whether or not to start the agent. If the agent is not going to be started then it loads the agent shim which has stubs for all the external api.
This may be invoked multiple times, as long as you don‘t attempt to uninstall the agent after it has been started.
If the plugin is initialized and it determines that the agent is not enabled, it will skip starting it and install the shim. But if you later call this with :agent_enabled => true, then it will install the real agent and start it.
What determines whether the agent is launched is the result of calling agent_enabled? This will indicate whether the instrumentation should/will be installed. If we‘re in a mode where tracers are not installed then we should not start the agent.
Subclasses are not allowed to override, but must implement init_config({}) which is called one or more times.