Note that there are some explanatory texts on larger screens.

plurals
  1. PONewRelic transaction traces in a Ruby Gem
    text
    copied!<p>I am developing a Ruby gem that I would like to add NewRelic monitoring to. The gem is used in a script that is run as a daemon and monitored by <code>bluepill</code>. I followed "<a href="https://docs.newrelic.com/docs/ruby/monitoring-ruby-background-processes-and-daemons" rel="nofollow">Monitoring Ruby background processes and daemons</a>" to get started. </p> <p>I confirmed the gem is establishing a connection with NewRelic as the application shows up in my portal there, however, there is no transaction traces or any metrics breakdown of the code being invoked.</p> <p>Here's the "entry" point of my gem as I tried to manually start the agent around the invoking method:</p> <pre><code>require 'fms/parser/version' require 'fms/parser/core' require 'fms/parser/env' require 'mongoid' ENV['NRCONFIG'] ||= File.dirname(__FILE__) + '/../newrelic.yml' require 'newrelic_rpm' module Fms module Parser def self.prepare_parse(filename) ::NewRelic::Agent.manual_start Mongoid.load!("#{File.dirname(__FILE__)}/../mongoid.yml", :development) Core.prepare_parse(filename) ::NewRelic::Agent.shutdown end end end </code></pre> <p>I also tried adding this into the module:</p> <pre><code> class &lt;&lt; self include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation add_transaction_tracer :prepare_parse, :category =&gt; :task end </code></pre> <p>I'm not entirely sure what else I can do. I confirmed the agent is able to communicate with the server and transaction traces are enabled. Nothing shows up in the background application tab either. </p> <p>This is the most useful information I've gotten from the agent log so far:</p> <pre><code>[12/23/13 21:21:03 +0000 apivm (7819)] INFO : Environment: development [12/23/13 21:21:03 +0000 apivm (7819)] INFO : No known dispatcher detected. [12/23/13 21:21:03 +0000 apivm (7819)] INFO : Application: MY-APP [12/23/13 21:21:03 +0000 apivm (7819)] INFO : Installing Net instrumentation [12/23/13 21:21:03 +0000 apivm (7819)] INFO : Finished instrumentation [12/23/13 21:21:04 +0000 apivm (7819)] INFO : Reporting to: https://rpm.newrelic.com/[MASKED_ACCOUNT_NUMBER] [12/23/13 22:12:06 +0000 apivm (7819)] INFO : Starting the New Relic agent in "development" environment. [12/23/13 22:12:06 +0000 apivm (7819)] INFO : To prevent agent startup add a NEWRELIC_ENABLE=false environment variable or modify the "development" section of your newrelic.yml. [12/23/13 22:12:06 +0000 apivm (7819)] INFO : Reading configuration from /var/lib/gems/1.9.1/gems/fms-parser-0.0.6/lib/fms/../newrelic.yml [12/23/13 22:12:06 +0000 apivm (7819)] INFO : Starting Agent shutdown </code></pre> <p>The only thing that's really concerning here is "No known dispatcher detected".</p> <p>Is what I'm trying to do possible?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload