Sha256: f12abb22b3b8fbb53325078e3a43f0f72c53f45dd357279b8eabde42ffd58b01

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 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
    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

2 entries across 2 versions & 1 rubygems

Version Path
newrelic_rpm-9.16.0 lib/new_relic/agent/instrumentation/httpclient.rb
newrelic_rpm-9.15.0 lib/new_relic/agent/instrumentation/httpclient.rb