This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionController::Instrumentation.class_eval do | |
def process_action(*args) | |
raw_payload = { | |
controller: self.class.name, | |
action: self.action_name, | |
params: request.filtered_parameters, | |
format: request.format.try(:ref), | |
method: request.method, | |
path: (request.fullpath rescue "unknown"), | |
request: request, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActiveSupport::Notifications::Instrumenter.class_eval do | |
def instrument(name, payload = {}) | |
start name, payload | |
begin | |
yield payload | |
rescue Exception => e | |
payload[:exception] = [e.class.name, e.message, e.backtrace] | |
raise e | |
ensure | |
finish name, payload |