Module NewRelic::Agent::Agent::InstanceMethods
In: lib/new_relic/agent/agent.rb

Holds all the methods defined on NewRelic::Agent::Agent instances

Methods

Included Modules

Start StartWorkerThread Connect

Classes and Modules

Module NewRelic::Agent::Agent::InstanceMethods::Connect
Module NewRelic::Agent::Agent::InstanceMethods::Start
Module NewRelic::Agent::Agent::InstanceMethods::StartWorkerThread

Attributes

agent_command_router  [R]  manages agent commands we receive from the collector, and the handlers
attribute_filter  [R] 
cross_app_encoding_bytes  [R] 
cross_app_monitor  [R] 
cross_process_id  [R]  cross application tracing ids and encoding
custom_event_aggregator  [R] 
error_collector  [R]  error collector is a simple collection of recorded errors
events  [R]  Global events dispatcher. This will provides our primary mechanism for agent-wide events, such as finishing configuration, error notification and request before/after from Rack.
harvest_samplers  [R] 
harvester  [R]  Responsbile for restarting the harvest thread
javascript_instrumentor  [R]  builder for JS agent scripts to inject
monotonic_gc_profiler  [R]  GC::Profiler.total_time is not monotonic so we wrap it.
record_sql  [R]  whether we should record raw, obfuscated, or no sql
service  [RW]  service for communicating with collector
sql_sampler  [R] 
stats_engine  [R]  the statistics engine that holds all the timeslice data
transaction_event_recorder  [R] 
transaction_rules  [R]  Transaction and metric renaming rules as provided by the collector on connect. The former are applied during txns, the latter during harvest.
transaction_sampler  [R]  the transaction sampler that handles recording transactions

Public Instance methods

This method should be called in a forked process after a fork. It assumes the parent process initialized the agent, but does not assume the agent started.

The call is idempotent, but not re-entrant.

  • It clears any metrics carried over from the parent process
  • Restarts the sampler thread if necessary
  • Initiates a new agent run and worker loop unless that was done in the parent process and +:force_reconnect+ is not true

Options:

  • :force_reconnect => true to force the spawned process to establish a new connection, such as when forking a long running process. The default is false—it will only connect to the server if the parent had not connected.
  • :keep_retrying => false if we try to initiate a new connection, this tells me to only try it once so this method returns quickly if there is some kind of latency with the server.

Check to see if the agent should start, returning true if it should.

Clear out the metric data, errors, and transaction traces, etc.

Pop the current trace execution status. Restore trace execution status to what it was before we pushed the current flag.

Push flag indicating whether we should be tracing in this thread. This uses a stack which allows us to disable tracing children of a transaction without affecting the tracing of the whole transaction

Clear out state for any objects that we know lock from our parents This is necessary for cases where we‘re in a forked child and Ruby might be holding locks for background thread that aren‘t there anymore.

Deprecated, and not part of the public API, but here for backwards compatibility because some 3rd-party gems call it. @deprecated

Sets a thread local variable as to whether we should or should not record sql in the current thread. Returns the previous value, if there is one

Sets a thread local variable as to whether we should or should not record transaction traces in the current thread. Returns the previous value, if there is one

Attempt a graceful shutdown of the agent, flushing any remaining data.

Logs a bunch of data and starts the agent, if needed

True if we have initialized and completed ‘start

[Validate]