Module: TraceView::Inst::ActionController4

Includes:
RailsBase
Included in:
ActionController::Base
Defined in:
lib/traceview/frameworks/rails/inst/action_controller.rb

Overview

ActionController4

This modules contains the instrumentation code specific to Rails v4

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RailsBase

#has_handler?, #log_rails_error?, #render_with_traceview

Class Method Details

.included(base) ⇒ Object



125
126
127
128
129
130
# File 'lib/traceview/frameworks/rails/inst/action_controller.rb', line 125

def self.included(base)
  base.class_eval do
    alias_method_chain :process_action, :traceview
    alias_method_chain :render, :traceview
  end
end

Instance Method Details

#process_action_with_traceview(method_name, *args) ⇒ Object



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/traceview/frameworks/rails/inst/action_controller.rb', line 132

def process_action_with_traceview(method_name, *args)
  return process_action_without_traceview(method_name, *args) if TraceView::Config[:action_blacklist].present? &&
    TraceView::Config[:action_blacklist][[self.controller_name, self.action_name].join('#')]

  report_kvs = {
    :Controller   => self.class.name,
    :Action       => self.action_name,
  }

  TraceView::API.log_entry('rails')
  process_action_without_traceview(method_name, *args)

rescue Exception => e
  TraceView::API.log_exception(nil, e) if log_rails_error?(e)
  raise
ensure
  TraceView::API.log_exit('rails')
end