How to send manually exceptions to NewRelic (Ruby)? -


how can send rescued exceptions newrelic ?

i have test file rpm.rb:

require 'newrelic_rpm' newrelic::agent.manual_start begin   "2" + 3 rescue typeerror => e   puts "whoa !"   newrelic::agent.agent.error_collector.notice_error( e ) end 

i start with:

newrelic_enable=true ruby rpm.rb 

the content of log/newrelic_agent.log:

[05/14/13 ... (87691)] info : reading configuration config/newrelic.yml [05/14/13 ... (87691)] info : environment: development [05/14/13 ... (87691)] warn : no dispatcher detected. [05/14/13 ... (87691)] info : application: xxx (development) [05/14/13 ... (87691)] info : installing net instrumentation [05/14/13 ... (87691)] info : audit log enabled @ '.../log/newrelic_audit.log' [05/14/13 ... (87691)] info : finished instrumentation [05/14/13 ... (87691)] info : reading configuration config/newrelic.yml [05/14/13 ... (87691)] info : starting agent shutdown 

the content of log/newrelic_audit.log

[2013-05-14 ... (87691)] : request: collector.newrelic.com:443/agent_listener/12/74901a11b7ff1a69aba11d1797830c8c1af41d56/get_redirect_host?marshal_format=json [2013-05-14 ... (87691)] : request body: [] 

nothing reported newrelic, why ?

i saw already: is there way push newrelic error manually?

you need set monitor_mode: true in config/newrelic.yml

development:   <<: *default_settings   # turn off communication new relic service in development mode (also   # 'enabled').   # note: initial evaluation purposes, may want temporarily   # turn agent on in development mode.   monitor_mode: true    # rails - when running in developer mode, new relic agent   # present performance information on last 100 transactions have   # executed since starting mongrel.   # note: there substantial overhead when running in developer mode.   # not use production or load testing.   developer_mode: true 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -