Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For debugging this problem, try the following code:</p> <pre><code>require 'fms/parser/version' require 'fms/parser/core' require 'fms/parser/env' require 'mongoid' ENV['NRCONFIG'] ||= File.dirname(__FILE__) + '/../newrelic.yml' # Make sure NewRelic has correct log file path ENV['NEW_RELIC_LOG'] ||= File.dirname(__FILE__) + '/../log/newrelic_agent.log' require 'newrelic_rpm' ::NewRelic::Agent.manual_start # For debug purposes: output some dots until we're connected to NewRelic until NewRelic::Agent.connected? do print '.' sleep 1 end module Fms module Parser class &lt;&lt; self include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation add_transaction_tracer :prepare_parse, :category =&gt; :task end def self.prepare_parse(filename) Mongoid.load!("#{File.dirname(__FILE__)}/../mongoid.yml", :development) Core.prepare_parse(filename) # Force the agent to prepare data before we shutdown ::NewRelic::Agent.load_data # NOTE: Ideally you'd want to shut down the agent just before the process exits... not every time you call Fms::Parser#prepare_parse ::NewRelic::Agent.shutdown(:force_send =&gt; true) end end end </code></pre> <p>I have a feeling that this probably has something to do with running your gem's code within the daemonized process that bluepill is starting. Ideally, we'd want to start the NewRelic agent within the process as soon after the daemon process is forked as we can get. Putting it after your library's requires should do this when the file is required.</p> <p>We also would most likely want to stop the NewRelic agent just before the background task process exits, not every time the <code>Fms::Parser#prepare_parse</code> method is called. However, for our purposes this should get you enough debugging info to continue, so you can ensure that the task is contacting New Relic the first time it's run. We can also try using <code>:force_send =&gt; true</code> to ensure we send the data.</p> <h3>References:</h3> <ul> <li>Blog Post: <a href="http://holmwood.id.au/~lindsay/2012/01/13/instrumenting-your-monitoring-checks-with-new-relic/" rel="nofollow">Instrumenting your monitoring checks with New Relic</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

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