Skip to content

Commit

Permalink
feat: add newrelic tracing (openedx#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharis278 authored Jan 22, 2024
1 parent 44d0126 commit fdfbe5b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Please See the `releases tab <https://github.com/openedx/xblock-lti-consumer/rel

Unreleased
~~~~~~~~~~
9.8.2 - 2024-01-19
------------------
* Add NewRelic traces to functions suspected of causing performance issues.

9.8.1 - 2023-11-17
------------------
Expand Down
2 changes: 1 addition & 1 deletion lti_consumer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from .apps import LTIConsumerApp
from .lti_xblock import LtiConsumerXBlock

__version__ = '9.8.1'
__version__ = '9.8.2'
2 changes: 2 additions & 0 deletions lti_consumer/lti_1p3/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from urllib.parse import urlencode
import uuid

from edx_django_utils.monitoring import function_trace
from django.conf import settings

from lti_consumer.lti_1p3.exceptions import InvalidClaimValue
Expand Down Expand Up @@ -103,6 +104,7 @@ def _get_user_roles(role):

return list(lti_user_roles)

@function_trace('lti_consumer.lti_1p3.consumer.prepare_preflight_url')
def prepare_preflight_url(
self,
launch_data,
Expand Down
3 changes: 3 additions & 0 deletions lti_consumer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from config_models.models import ConfigurationModel
from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from edx_django_utils.monitoring import function_trace
from lti_consumer.filters import get_external_config_from_filter

# LTI 1.1
Expand Down Expand Up @@ -280,6 +281,7 @@ def clean(self):
if consumer is None:
raise ValidationError(_("Invalid LTI configuration."))

@function_trace('lti_consumer.models.LtiConfiguration.sync_configurations')
def sync_configurations(self):
"""Syncronize main/children configurations.
Expand Down Expand Up @@ -611,6 +613,7 @@ def _get_lti_1p3_consumer(self):

return consumer

@function_trace('lti_consumer.models.LtiConfiguration.get_lti_consumer')
def get_lti_consumer(self):
"""
Returns an instanced class of LTI 1.1 or 1.3 consumer.
Expand Down

0 comments on commit fdfbe5b

Please sign in to comment.