Sha256: 645cbc5a605471c5b9febd2beb95382819dc6957b17215ee4577422b4e6be241

Contents?: true

Size: 847 Bytes

Versions: 61

Compression:

Stored size: 847 Bytes

Contents

DependencyDetection.defer do
  @name = :net

  depends_on do
    defined?(Net) && defined?(Net::HTTP)
  end
  
  executes do
    NewRelic::Agent.logger.debug 'Installing Net instrumentation'
  end
  
  executes do
    Net::HTTP.class_eval do
      def request_with_newrelic_trace(*args, &block)
        metrics = ["External/#{@address}/Net::HTTP/#{args[0].method}", "External/#{@address}/all", "External/all"]
        if NewRelic::Agent::Instrumentation::MetricFrame.recording_web_transaction?
          metrics << "External/allWeb"
        else
          metrics << "External/allOther"
        end
        self.class.trace_execution_scoped metrics do
          request_without_newrelic_trace(*args, &block)
        end
      end
      alias request_without_newrelic_trace request
      alias request request_with_newrelic_trace
    end
  end
end

Version data entries

61 entries across 61 versions & 4 rubygems

Version Path
newrelic_rpm-3.5.4.35.beta lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.4.34 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.4.33 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.4.31.beta lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.4.29.beta lib/new_relic/agent/instrumentation/net.rb
ghazel-newrelic_rpm-3.5.4 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.3.25 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.3.24 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.2.17 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.1.14 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.1.14.beta lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.1.beta1 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.0.1 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.1.alpha lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.5.0 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.4.2.1 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.4.2 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.4.2.beta1 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.4.1 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.4.1.beta1 lib/new_relic/agent/instrumentation/net.rb