module NewRelic::Agent::Instrumentation::DynamoDB::Chain

Public Class Methods

instrument!() click to toggle source
# File lib/new_relic/agent/instrumentation/dynamodb/chain.rb, line 7
def self.instrument!
  ::Aws::DynamoDB::Client.class_eval do
    include NewRelic::Agent::Instrumentation::DynamoDB

    NewRelic::Agent::Instrumentation::DynamoDB::INSTRUMENTED_METHODS.each do |method_name|
      alias_method("#{method_name}_without_new_relic".to_sym, method_name.to_sym)

      define_method(method_name) do |*args|
        instrument_method_with_new_relic(method_name, *args) { send("#{method_name}_without_new_relic".to_sym, *args) }
      end
    end

    alias_method(:build_request_without_new_relic, :build_request)

    def build_request(*args)
      build_request_with_new_relic(*args) { build_request_without_new_relic(*args) }
    end
  end
end

Public Instance Methods

build_request(*args) click to toggle source
# File lib/new_relic/agent/instrumentation/dynamodb/chain.rb, line 21
def build_request(*args)
  build_request_with_new_relic(*args) { build_request_without_new_relic(*args) }
end