Sha256: 9ebc4ac963f481dc31334de224f5b378c5413210ddff439d400f52a24ad5429f

Contents?: true

Size: 1.1 KB

Versions: 26

Compression:

Stored size: 1.1 KB

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require_relative 'httpclient/instrumentation'
require_relative 'httpclient/chain'
require_relative 'httpclient/prepend'

DependencyDetection.defer do
  named :httpclient

  HTTPCLIENT_MIN_VERSION = '2.2.0'

  depends_on do
    defined?(HTTPClient) && defined?(HTTPClient::VERSION)
  end

  depends_on do
    minimum_supported_version = Gem::Version.new(HTTPCLIENT_MIN_VERSION)
    current_version = Gem::Version.new(HTTPClient::VERSION)

    current_version >= minimum_supported_version
  end

  executes do
    NewRelic::Agent.logger.info('Installing HTTPClient instrumentation')
    require 'new_relic/agent/distributed_tracing/cross_app_tracing'
    require 'new_relic/agent/http_clients/httpclient_wrappers'
  end

  executes do
    if use_prepend?
      prepend_instrument HTTPClient, NewRelic::Agent::Instrumentation::HTTPClient::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::HTTPClient::Chain
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
newrelic_rpm-9.14.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.13.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.12.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.11.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.10.2 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.10.1 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.10.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.9.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.8.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.7.1 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.7.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.6.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.5.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.4.2 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.4.1 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.4.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.3.1 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.3.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.2.2 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.2.1 lib/new_relic/agent/instrumentation/httpclient.rb