Commit 69af4113 by David Ormsbee

Merge pull request #7979 from edx/ormsbee/new_relic_xb_tx_reporting

Customize the transaction name sent to New Relic for XBlock handlers.
parents 00184b83 f1f34b5d
......@@ -26,6 +26,8 @@ from django.http import Http404, HttpResponse
from django.test.client import RequestFactory
from django.views.decorators.csrf import csrf_exempt
import newrelic.agent
from capa.xqueue_interface import XQueueInterface
from courseware.access import has_access, get_user_role
from courseware.masquerade import setup_masquerade
......@@ -909,6 +911,13 @@ def _invoke_xblock_handler(request, course_id, usage_id, handler, suffix):
instance, tracking_context = get_module_by_usage_id(request, course_id, usage_id)
# Name the transaction so that we can view XBlock handlers separately in
# New Relic. The suffix is necessary for XModule handlers because the
# "handler" in those cases is always just "xmodule_handler".
nr_tx_name = "{}.{}".format(instance.__class__.__name__, handler)
nr_tx_name += "/{}".format(suffix) if suffix else ""
newrelic.agent.set_transaction_name(nr_tx_name, group="Python/XBlock/Handler")
tracking_context_name = 'module_callback_handler'
req = django_to_webob_request(request)
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment