Skip to content

Commit

Permalink
Use recording web transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Kayser committed Feb 10, 2010
1 parent f330a28 commit f65cb23
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/new_relic/agent/instrumentation/net.rb
@@ -1,18 +1,18 @@
if defined? Net::HTTP
Net::HTTP.class_eval do
def request_with_newrelic_trace(*args, &block)
if Thread::current[:newrelic_scope_name].nil?
self.class.trace_execution_unscoped(["External/#{@address}/Net::HTTP/#{args[0].method}",
"External/#{@address}/all",
"External/allOther"]) do
request_without_newrelic_trace(*args, &block)
end
else
if NewRelic::Agent::Instrumentation::MetricFrame.recording_web_transaction?
self.class.trace_execution_scoped(["External/#{@address}/Net::HTTP/#{args[0].method}",
"External/#{@address}/all",
"External/allWeb"]) do
request_without_newrelic_trace(*args, &block)
end
else
self.class.trace_execution_unscoped(["External/#{@address}/Net::HTTP/#{args[0].method}",
"External/#{@address}/all",
"External/allOther"]) do
request_without_newrelic_trace(*args, &block)
end
end
end
alias request_without_newrelic_trace request
Expand Down

0 comments on commit f65cb23

Please sign in to comment.