module AppPerfRpm::Instruments::ActionController

Public Instance Methods

perform_action_with_trace(*arguments) click to toggle source
# File lib/app_perf_rpm/instruments/action_controller.rb, line 29
def perform_action_with_trace(*arguments)
  if ::AppPerfRpm::Tracer.tracing?
    operation = "#{@_request.path_parameters['controller']}##{@_request.path_parameters['action']}"
    span = AppPerfRpm.tracer.start_span(operation, tags: {
      "component" => "ActionController",
      "span.kind" => "client"
    })
    AppPerfRpm::Utils.log_source_and_backtrace(span, :action_controller)
  end
  perform_action_without_trace(*arguments)
rescue Exception => e
  if span
    span.set_tag('error', true)
    span.log_error(e)
  end
  raise
ensure
  span.finish if span
end
process_action_with_trace(method_name, *args) click to toggle source
# File lib/app_perf_rpm/instruments/action_controller.rb, line 6
def process_action_with_trace(method_name, *args)
  if ::AppPerfRpm::Tracer.tracing?
    operation = "#{self.class.name}##{self.action_name}"
    span = AppPerfRpm.tracer.start_span(operation, tags: {
      "component" => "ActionController",
      "span.kind" => "client"
    })
    AppPerfRpm::Utils.log_source_and_backtrace(span, :action_controller)
  end

  process_action_without_trace(method_name, *args)
rescue Exception => e
  puts e.message.inspect
  puts e.backtrace.join("\n")
  if span
    span.set_tag('error', true)
    span.log_error(e)
  end
  raise
ensure
  span.finish if span
end