Method: NewRelic::Agent#manual_start

Defined in:
lib/new_relic/agent.rb

#manual_start(options = {}) ⇒ Object

Call this to manually start the agent in situations where the agent does not auto-start.

When the app environment loads, so does the agent. However, the agent will only connect to the service if a web front-end is found. If you want to selectively monitor ruby processes that don’t use web plugins, then call this method in your code and the agent will fire up and start reporting to the service.

Options are passed in as overrides for values in the newrelic.yml, such as app_name. In addition, the option log will take a logger that will be used instead of the standard file logger. The setting for the newrelic.yml section to use (ie, RAILS_ENV) can be overridden with an :env argument.



596
597
598
599
600
601
# File 'lib/new_relic/agent.rb', line 596

def manual_start(options = {})
  raise 'Options must be a hash' unless Hash === options

  NewRelic::Control.instance.init_plugin({:agent_enabled => true, :sync_startup => true}.merge(options))
  record_api_supportability_metric(:manual_start)
end