Sha256: a18a4b15db1ea926e7d5eaf2225d481f6a03ab6e184639085daacd0ff32a8946

Contents?: true

Size: 887 Bytes

Versions: 7

Compression:

Stored size: 887 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.


DependencyDetection.defer do
  @name = :net

  depends_on do
    defined?(Net) && defined?(Net::HTTP)
  end

  executes do
    ::NewRelic::Agent.logger.info 'Installing Net instrumentation'
    require 'new_relic/agent/cross_app_tracing'
  end

  executes do
    class Net::HTTP

      # Instrument outgoing HTTP requests and fire associated events back
      # into the Agent.
      def request_with_newrelic_trace(request, *args, &block)
        NewRelic::Agent::CrossAppTracing.trace_http_request( self, request ) do
          request_without_newrelic_trace( request, *args, &block )
        end
      end

      alias request_without_newrelic_trace request
      alias request request_with_newrelic_trace
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-3.6.1.88 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.6.1.87 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.6.1.86.beta lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.6.1.85.beta lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.6.0.83 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.6.0.78 lib/new_relic/agent/instrumentation/net.rb
newrelic_rpm-3.6.0.74.beta lib/new_relic/agent/instrumentation/net.rb