Sha256: 7dffe78c1cc04e81c26be1f5cef8ce6513108a922d6f29214f8866f6c0b0e784

Contents?: true

Size: 1.24 KB

Versions: 6

Compression:

Stored size: 1.24 KB

Contents

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

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

      def process_action(method_name, *args)
        kvs = {
          :Controller   => self.class.name,
          :Action       => self.action_name,
        }
        kvs[:Backtrace] = TraceView::API.backtrace if TraceView::Config[:action_controller_api][:collect_backtraces]

        TraceView::API.log_entry('rails-api', kvs)
        super(method_name, *args)

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

      #
      # render
      #
      # Our render wrapper that just times and conditionally
      # reports raised exceptions
      #
      def render(*args, &blk)
        TraceView::API.log_entry('actionview')
        super(*args, &blk)

      rescue Exception => e
        TraceView::API.log_exception(nil, e) if log_rails_error?(e)
        raise
      ensure
        TraceView::API.log_exit('actionview')
      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_controller_api.rb
traceview-3.8.3 lib/traceview/frameworks/rails/inst/action_controller_api.rb
traceview-3.8.2-java lib/traceview/frameworks/rails/inst/action_controller_api.rb
traceview-3.8.2 lib/traceview/frameworks/rails/inst/action_controller_api.rb
traceview-3.8.1-java lib/traceview/frameworks/rails/inst/action_controller5_api.rb
traceview-3.8.1 lib/traceview/frameworks/rails/inst/action_controller5_api.rb