Skip to content

Commit

Permalink
RUBY-1645 Remove ActiveRecord instrumentation-level datastore instanc…
Browse files Browse the repository at this point in the history
…e config gating
  • Loading branch information
kwugirl committed Oct 19, 2016
1 parent 29dfa6d commit 849ab00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
10 changes: 3 additions & 7 deletions lib/new_relic/agent/instrumentation/active_record.rb
Expand Up @@ -55,13 +55,9 @@ def log_with_newrelic_instrumentation(*args, &block) #THREAD_LOCAL_ACCESS
database = nil

if ActiveRecordHelper::InstanceIdentification.supported_adapter?(@config)
if NewRelic::Agent.config[:'datastore_tracer.instance_reporting.enabled']
host = ActiveRecordHelper::InstanceIdentification.host(@config)
port_path_or_id = ActiveRecordHelper::InstanceIdentification.port_path_or_id(@config)
end
if NewRelic::Agent.config[:'datastore_tracer.database_name_reporting.enabled']
database = @config && @config[:database]
end
host = ActiveRecordHelper::InstanceIdentification.host(@config)
port_path_or_id = ActiveRecordHelper::InstanceIdentification.port_path_or_id(@config)
database = @config && @config[:database]
end

segment = NewRelic::Agent::Transaction.start_datastore_segment(product, operation, collection, host, port_path_or_id, database)
Expand Down
10 changes: 3 additions & 7 deletions lib/new_relic/agent/instrumentation/active_record_subscriber.rb
Expand Up @@ -93,13 +93,9 @@ def start_segment
database = nil

if ActiveRecordHelper::InstanceIdentification.supported_adapter?(@config)
if NewRelic::Agent.config[:'datastore_tracer.instance_reporting.enabled']
host = ActiveRecordHelper::InstanceIdentification.host(@config)
port_path_or_id = ActiveRecordHelper::InstanceIdentification.port_path_or_id(@config)
end
if NewRelic::Agent.config[:'datastore_tracer.database_name_reporting.enabled']
database = @config && @config[:database]
end
host = ActiveRecordHelper::InstanceIdentification.host(@config)
port_path_or_id = ActiveRecordHelper::InstanceIdentification.port_path_or_id(@config)
database = @config && @config[:database]
end

segment = NewRelic::Agent::Transaction::DatastoreSegment.new product, operation, collection, host, port_path_or_id, database
Expand Down

0 comments on commit 849ab00

Please sign in to comment.