Sha256: d988b81c22a83ecfd3f4449a7a9c95a9b555ce1618777d0a50239a32f9964fa3

Contents?: true

Size: 918 Bytes

Versions: 10

Compression:

Stored size: 918 Bytes

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 'async_http/instrumentation'
require_relative 'async_http/chain'
require_relative 'async_http/prepend'

DependencyDetection.defer do
  named :async_http

  depends_on do
    defined?(Async::HTTP) &&
      Gem::Version.new(Async::HTTP::VERSION) >= Gem::Version.new('0.59.0') &&
      !defined?(Traces::Backend::NewRelic) # defined in the traces-backend-newrelic gem
  end

  executes do
    NewRelic::Agent.logger.info('Installing async_http instrumentation')

    require 'async/http/internet'
    if use_prepend?
      prepend_instrument Async::HTTP::Internet, NewRelic::Agent::Instrumentation::AsyncHttp::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::AsyncHttp::Chain
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
newrelic_rpm-9.14.0 lib/new_relic/agent/instrumentation/async_http.rb
newrelic_rpm-9.13.0 lib/new_relic/agent/instrumentation/async_http.rb
newrelic_rpm-9.12.0 lib/new_relic/agent/instrumentation/async_http.rb
newrelic_rpm-9.11.0 lib/new_relic/agent/instrumentation/async_http.rb
newrelic_rpm-9.10.2 lib/new_relic/agent/instrumentation/async_http.rb
newrelic_rpm-9.10.1 lib/new_relic/agent/instrumentation/async_http.rb
newrelic_rpm-9.10.0 lib/new_relic/agent/instrumentation/async_http.rb
newrelic_rpm-9.9.0 lib/new_relic/agent/instrumentation/async_http.rb
newrelic_rpm-9.8.0 lib/new_relic/agent/instrumentation/async_http.rb
newrelic_rpm-9.7.1 lib/new_relic/agent/instrumentation/async_http.rb