lib/new_relic/agent/agent.rb in newrelic_rpm-3.4.0 vs lib/new_relic/agent/agent.rb in newrelic_rpm-3.4.0.1
- old
+ new
@@ -28,11 +28,14 @@
@last_harvest_time = Time.now
@obfuscator = lambda {|sql| NewRelic::Agent::Database.default_sql_obfuscator(sql) }
@forked = false
- @service = NewRelic::Agent::NewRelicService.new(control.license_key, control.server)
+ # FIXME: temporary work around for RUBY-839
+ if control.monitor_mode?
+ @service = NewRelic::Agent::NewRelicService.new(control.license_key, control.server)
+ end
end
# contains all the class-level methods for NewRelic::Agent::Agent
module ClassMethods
# Should only be called by NewRelic::Control - returns a
@@ -864,11 +867,11 @@
control.merge_server_side_config(config_data) if @server_side_config_enabled
config_transaction_tracer
log_connection!(config_data)
configure_transaction_tracer!(config_data['collect_traces'], config_data['sample_rate'])
- configure_error_collector!(config_data['error_collector.enabled'])
+ configure_error_collector!(config_data['collect_errors'])
end
# Logs when we connect to the server, for debugging purposes
# - makes sure we know if an agent has not connected
def log_connection!(config_data)
@@ -1004,9 +1007,11 @@
# note - exceptions are logged in invoke_remote. If an exception is encountered here,
# then the metric data is downsampled for another
# transmission later
def harvest_and_send_timeslice_data
now = Time.now
+ NewRelic::Agent.instance.stats_engine.get_stats_no_scope('Supportability/invoke_remote').record_data_point(0.0)
+ NewRelic::Agent.instance.stats_engine.get_stats_no_scope('Supportability/invoke_remote/metric_data').record_data_point(0.0)
harvest_timeslice_data(now)
# In this version of the protocol, we get back an assoc array of spec to id.
metric_specs_and_ids = @service.metric_data(@last_harvest_time.to_f,
now.to_f,
@unsent_timeslice_data.values)