Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
From 22892277d516802b88a84e70286a25c6657b76ec Mon Sep 17 00:00:00 2001
From: Steve Clamage <steve@smule.com>
Date: Fri, 6 May 2011 16:50:22 -0400
Subject: [PATCH] Adding method chaining so that rpm plays nice with other plugins that wrap process_action.
---
.../instrumentation/rails3/action_controller.rb | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/vendor/plugins/rpm/lib/new_relic/agent/instrumentation/rails3/action_controller.rb b/vendor/plugins/rpm/lib/new_relic/agent/instrumentation/rails3/action_controller.rb
index 0c3f69f..a931ce8 100644
--- a/vendor/plugins/rpm/lib/new_relic/agent/instrumentation/rails3/action_controller.rb
+++ b/vendor/plugins/rpm/lib/new_relic/agent/instrumentation/rails3/action_controller.rb
@@ -22,16 +22,16 @@ module NewRelic
end
end
- def process_action(*args)
+ def process_action_with_newrelic_trace(*args)
# skip instrumentation if we are in an ignored action
if _is_filtered?('do_not_trace')
NewRelic::Agent.disable_all_tracing do
- return super
+ return process_action_without_newrelic_trace(*args)
end
end
perform_action_with_newrelic_trace(:category => :controller, :name => self.action_name, :path => newrelic_metric_path, :params => request.filtered_parameters, :class_name => self.class.name) do
- super
+ process_action_without_newrelic_trace(*args)
end
end
@@ -54,6 +54,7 @@ DependencyDetection.defer do
class ActionController::Base
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
include NewRelic::Agent::Instrumentation::Rails3::ActionController
+ alias_method_chain :process_action, :newrelic_trace
end
end
end
--
1.7.3.3+GitX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.