Sha256: f16f43b9653198c43a6af508ab6f4a0378d09a4b7afd9a53db9da77b9b7fd72e

Contents?: true

Size: 1.29 KB

Versions: 13

Compression:

Stored size: 1.29 KB

Contents

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

require_relative 'typhoeus/instrumentation'
require_relative 'typhoeus/chain'
require_relative 'typhoeus/prepend'

DependencyDetection.defer do
  named :typhoeus

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

  depends_on do
    NewRelic::Agent::Instrumentation::Typhoeus.is_supported_version?
  end

  executes do
    ::NewRelic::Agent.logger.info 'Installing Typhoeus instrumentation'
    require 'new_relic/agent/distributed_tracing/cross_app_tracing'
    require 'new_relic/agent/http_clients/typhoeus_wrappers'
  end

  # Basic request tracing
  executes do
    Typhoeus.before do |request|
      NewRelic::Agent::Instrumentation::Typhoeus.trace(request)

      # Ensure that we always return a truthy value from the before block,
      # otherwise Typhoeus will bail out of the instrumentation.
      true
    end
  end

  # Apply single TT node for Hydra requests until async support
  executes do
    if use_prepend?
      prepend_instrument Typhoeus::Hydra, NewRelic::Agent::Instrumentation::Typhoeus::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::Typhoeus::Chain
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
newrelic_rpm-8.9.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-8.8.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-8.7.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-8.6.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-8.5.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-8.4.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-8.3.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-8.2.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-8.1.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-8.0.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-7.2.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-7.1.0 lib/new_relic/agent/instrumentation/typhoeus.rb
newrelic_rpm-7.0.0 lib/new_relic/agent/instrumentation/typhoeus.rb