Sha256: cd7a9e1ffde0619436717c34a9370f73166c401a48ea0800b38456453fee7e32

Contents?: true

Size: 1.29 KB

Versions: 6

Compression:

Stored size: 1.29 KB

Contents

# Copyright (c) 2016 AppNeta, Inc.
# All rights reserved.

module TraceView
  module Inst
    #
    # ActionController
    #
    # This modules contains the instrumentation code specific
    # to Rails v3
    #
    module ActionController
      include ::TraceView::Inst::RailsBase

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

      def process_with_traceview(*args)
        TraceView::API.log_entry('rails')
        process_without_traceview(*args)

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

      def process_action_with_traceview(*args)
        kvs = {
          :Controller   => self.class.name,
          :Action       => action_name,
        }
        kvs[:Backtrace] = TraceView::API.backtrace if TraceView::Config[:action_controller][:collect_backtraces]
        TraceView::API.log(nil, 'info', kvs)

        process_action_without_traceview(*args)
      rescue Exception
        kvs[:Status] = 500
        TraceView::API.log(nil, 'info', kvs)
        raise
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
traceview-3.8.3-java lib/traceview/frameworks/rails/inst/action_controller3.rb
traceview-3.8.3 lib/traceview/frameworks/rails/inst/action_controller3.rb
traceview-3.8.2-java lib/traceview/frameworks/rails/inst/action_controller3.rb
traceview-3.8.2 lib/traceview/frameworks/rails/inst/action_controller3.rb
traceview-3.8.1-java lib/traceview/frameworks/rails/inst/action_controller3.rb
traceview-3.8.1 lib/traceview/frameworks/rails/inst/action_controller3.rb