allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [allura] branch master updated: [#8276] polish up new relic hooks
Date Fri, 12 Apr 2019 21:44:59 GMT
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git


The following commit(s) were added to refs/heads/master by this push:
     new 78a4951  [#8276] polish up new relic hooks
78a4951 is described below

commit 78a4951fdb2f3fd52af6be8913a398068adea2c8
Author: Dave Brondsema <dave@brondsema.net>
AuthorDate: Fri Apr 12 17:44:41 2019 -0400

    [#8276] polish up new relic hooks
---
 Allura/allura/lib/patches.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Allura/allura/lib/patches.py b/Allura/allura/lib/patches.py
index ab58968..9105250 100644
--- a/Allura/allura/lib/patches.py
+++ b/Allura/allura/lib/patches.py
@@ -110,9 +110,6 @@ def apply():
             return original_tg_jsonify_GenericJSON_encode(self, o)
 
 
-# must be saved outside the newrelic() method so that multiple newrelic()
-# calls (e.g. during tests) don't cause the patching to get applied to itself
-# over and over
 old_controller_call = tg.controllers.DecoratedController._call
 
 
@@ -127,4 +124,8 @@ def newrelic():
         return old_controller_call(self, controller, *args, **kwargs)
 
     import newrelic.api.error_trace
-    newrelic.api.error_trace.wrap_error_trace('tg.wsgiapp', 'TGApp.__call__')
\ No newline at end of file
+    # These are based on newrelic/hooks/framework_pylons.py since TG is similar to Pylons
+    # capture exceptions:
+    newrelic.api.error_trace.wrap_error_trace('tg.wsgiapp', 'TGApp.__call__')
+    # record as its own component in transaction breakdown; should help distinguish middleware
vs controller time
+    newrelic.api.function_trace.wrap_function_trace('tg.controllers.tgcontroller', 'TGController.__call__')


Mime
View raw message