lib/new_relic/agent/instrumentation/rake/instrumentation.rb in newrelic_rpm-9.0.0 vs lib/new_relic/agent/instrumentation/rake/instrumentation.rb in newrelic_rpm-9.1.0

- old
+ new

@@ -14,11 +14,11 @@ begin timeout = NewRelic::Agent.config[:'rake.connect_timeout'] NewRelic::Agent.instance.wait_on_connect(timeout) rescue => e - NewRelic::Agent.logger.error("Exception in wait_on_connect", e) + NewRelic::Agent.logger.error('Exception in wait_on_connect', e) return yield end NewRelic::Agent::Instrumentation::Rake.before_invoke_transaction(self) @@ -34,13 +34,13 @@ def should_install? safe_from_third_party_gem? end def safe_from_third_party_gem? - return true unless NewRelic::LanguageSupport.bundled_gem?("newrelic-rake") + return true unless NewRelic::LanguageSupport.bundled_gem?('newrelic-rake') - ::NewRelic::Agent.logger.info("Not installing New Relic supported Rake instrumentation because the third party newrelic-rake gem is present") + ::NewRelic::Agent.logger.info('Not installing New Relic supported Rake instrumentation because the third party newrelic-rake gem is present') false end def should_trace?(name) NewRelic::Agent.config[:'rake.tasks'].any? do |regex| @@ -70,11 +70,11 @@ end def instrument_invoke_prerequisites_concurrently(task) task.instance_eval do def invoke_prerequisites_concurrently(*_) - NewRelic::Agent::MethodTracer.trace_execution_scoped("Rake/execute/multitask") do + NewRelic::Agent::MethodTracer.trace_execution_scoped('Rake/execute/multitask') do super end end end end @@ -85,25 +85,25 @@ instrument_execute_on_prereqs(task) if task.application.options.always_multitask instrument_invoke_prerequisites_concurrently(task) end rescue => e - NewRelic::Agent.logger.error("Error during Rake task invoke", e) + NewRelic::Agent.logger.error('Error during Rake task invoke', e) end def record_attributes(args, task) - command_line = task.application.top_level_tasks.join(" ") + command_line = task.application.top_level_tasks.join(' ') NewRelic::Agent::Transaction.merge_untrusted_agent_attributes({:command => command_line}, :'job.rake', NewRelic::Agent::AttributeFilter::DST_NONE) named_args = name_the_args(args, task.arg_names) unless named_args.empty? NewRelic::Agent::Transaction.merge_untrusted_agent_attributes(named_args, :'job.rake.args', NewRelic::Agent::AttributeFilter::DST_NONE) end rescue => e - NewRelic::Agent.logger.error("Error during Rake task attribute recording.", e) + NewRelic::Agent.logger.error('Error during Rake task attribute recording.', e) end # Expects literal args passed to the task and array of task names # If names are present without matching args, still sets them with nils def name_the_args(args, names)