ARCHBOM-1494: Refer to custom attributes, not metrics, especially with edx-django-utils (#25010)

This uses the new names introduced in edx-django-utils
3.8.0 (edx/edx-django-utils#59), which we're already using, as
well as updating a few other locations where we incorrectly refer
to New Relic custom metrics instead of custom attributes.

Includes a couple of unrelated lint fixes in a file I modified.
This commit is contained in:
Tim McCormack
2020-09-18 09:33:50 -04:00
committed by GitHub
parent f037767cb4
commit ba9ee4e151
29 changed files with 124 additions and 115 deletions

View File

@@ -3,7 +3,7 @@ Unified course experience settings and helper methods.
"""
import crum
from django.utils.translation import ugettext as _
from edx_django_utils.monitoring import set_custom_metric
from edx_django_utils.monitoring import set_custom_attribute
from waffle import flag_is_active
from lms.djangoapps.experiments.flags import ExperimentWaffleFlag
@@ -55,7 +55,7 @@ class DefaultTrueWaffleFlagNamespace(WaffleFlagNamespace):
if request:
value = flag_is_active(request, namespaced_flag_name)
else:
set_custom_metric('warn_flag_no_request', True)
set_custom_attribute('warn_flag_no_request', True)
# Return the default value if not in a request context.
# Same as the original implementation
self._set_waffle_flag_metric(namespaced_flag_name, value)