Module: ScoutApm::Instruments::ActionControllerRails3Rails4Instruments

Defined in:
lib/scout_apm/instruments/action_controller_rails_3_rails4.rb

Instance Method Summary collapse

Instance Method Details

#process_action(*args) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/scout_apm/instruments/action_controller_rails_3_rails4.rb', line 60

def process_action(*args)
  req = ScoutApm::RequestManager.lookup
  path = ScoutApm::Agent.instance.config.value("uri_reporting") == 'path' ? request.path : request.fullpath
  req.annotate_request(:uri => path)

  # IP Spoofing Protection can throw an exception, just move on w/o remote ip
  req.context.add_user(:ip => request.remote_ip) rescue nil

  req.set_headers(request.headers)
  req.web!

  req.start_layer( ScoutApm::Layer.new("Controller", "#{controller_path}/#{action_name}") )
  begin
    super
  rescue
    req.error!
    raise
  ensure
    req.stop_layer
  end
end