From 697b3d7d98788ba7abbb76bcece02ed60db8ad22 Mon Sep 17 00:00:00 2001 From: Nimisha Asthagiri Date: Tue, 7 Feb 2017 19:29:17 -0500 Subject: [PATCH] Add new relic parameters to grades task --- lms/djangoapps/grades/tasks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lms/djangoapps/grades/tasks.py b/lms/djangoapps/grades/tasks.py index c72aad70c6..20716ddca2 100644 --- a/lms/djangoapps/grades/tasks.py +++ b/lms/djangoapps/grades/tasks.py @@ -12,6 +12,7 @@ from logging import getLogger from courseware.model_data import get_score from lms.djangoapps.course_blocks.api import get_course_blocks +import newrelic.agent from openedx.core.djangoapps.celery_utils.persist_on_failure import PersistOnFailureTask from opaque_keys.edx.keys import UsageKey from opaque_keys.edx.locator import CourseLocator @@ -74,6 +75,9 @@ def _recalculate_subsection_grade(self, **kwargs): scored_block_usage_key = UsageKey.from_string(kwargs['usage_id']).replace(course_key=course_key) + newrelic.agent.add_custom_parameter('course_id', unicode(course_key)) + newrelic.agent.add_custom_parameter('usage_id', unicode(scored_block_usage_key)) + # The request cache is not maintained on celery workers, # where this code runs. So we take the values from the # main request cache and store them in the local request