module NewRelic::Agent::Instrumentation::Grape::Chain

Public Class Methods

instrument!() click to toggle source
# File lib/new_relic/agent/instrumentation/grape/chain.rb, line 8
def self.instrument!
  Grape::Instrumentation.instrumented_class.class_eval do
    def call_with_new_relic(env)
      begin
        call_without_new_relic(env)
      ensure
        Grape::Instrumentation.capture_transaction(env, self)
      end
    end

    alias_method(:call_without_new_relic, :call)
    alias_method(:call, :call_with_new_relic)
  end
end

Public Instance Methods

call_with_new_relic(env) click to toggle source
# File lib/new_relic/agent/instrumentation/grape/chain.rb, line 10
def call_with_new_relic(env)
  begin
    call_without_new_relic(env)
  ensure
    Grape::Instrumentation.capture_transaction(env, self)
  end
end