Sha256: 721ae6cc10b11cb594248149ac56dd3f012c5265db522b8e3786fa115484a727

Contents?: true

Size: 1.32 KB

Versions: 16

Compression:

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

module NewRelic::Agent::Instrumentation
  module Ethon
    module Chain
      def self.instrument!
        ::Ethon::Easy.class_eval do
          include NewRelic::Agent::Instrumentation::Ethon::Easy

          alias_method(:fabricate_without_tracing, :fabricate)
          def fabricate(url, action_name, options)
            fabricate_with_tracing(url, action_name, options) { fabricate_without_tracing(url, action_name, options) }
          end

          alias_method(:headers_equals_without_tracing, :headers=)
          def headers=(headers)
            headers_equals_with_tracing(headers) { headers_equals_without_tracing(headers) }
          end

          alias_method(:perform_without_tracing, :perform)
          def perform(*args)
            perform_with_tracing(*args) { perform_without_tracing(*args) }
          end
        end

        ::Ethon::Multi.class_eval do
          include NewRelic::Agent::Instrumentation::Ethon::Multi

          alias_method(:perform_without_tracing, :perform)
          def perform(*args)
            perform_with_tracing(*args) { perform_without_tracing(*args) }
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
newrelic_rpm-9.17.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.16.1 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.16.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.15.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.14.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.13.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.12.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.11.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.10.2 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.10.1 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.10.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.9.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.8.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.7.1 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.7.0 lib/new_relic/agent/instrumentation/ethon/chain.rb
newrelic_rpm-9.6.0 lib/new_relic/agent/instrumentation/ethon/chain.rb