# encoding: utf-8 module OneApm module Agent module Instrumentation module Rails3 module Errors def oneapm_notice_error(exception, custom_params = {}) filtered_params = (respond_to? :filter_parameters) ? filter_parameters(params) : params filtered_params.merge!(custom_params) OneApm::Transaction.notice_error( \ exception, \ :request => request, \ :metric => oneapm_metric_path, \ :custom_params => filtered_params) end end end end end end LibraryDetection.defer do @name = :rails3_error depends_on do defined?(::Rails) && ::Rails::VERSION::MAJOR.to_i == 3 end depends_on do defined?(ActionController) && defined?(ActionController::Base) end executes do OneApm::Manager.logger.info 'Installing Rails 3 Error instrumentation' end executes do class ActionController::Base include OneApm::Agent::Instrumentation::Rails3::Errors end end end