From 57ef2d50d9a7082936b88be978df1d42caf1ab70 Mon Sep 17 00:00:00 2001 From: Robert Raposa <rraposa@edx.org> Date: Thu, 5 Dec 2024 15:47:30 -0500 Subject: [PATCH] fixup! code review feedback - add min constraint edx-django-utils>=7.1.0 - change changelog date and fix typo - * add unreleased changelog to 6.0.0 - add request argument --- CHANGELOG.rst | 11 ++++++----- .../datadog_monitoring/signals/handlers.py | 12 ++++++------ requirements/base.in | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index abcf5a3..0ef88b5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -13,15 +13,16 @@ Change Log Unreleased ~~~~~~~~~~ -Added ------ -* Adds search script datadog_search.py, for searching Datadog monitors and dashboards. -[6.0.0] - 2024-11-05 +[6.0.0] - 2024-12-05 ~~~~~~~~~~~~~~~~~~~~ Removed ------- -- Removes CodeOwnerMonitoringMiddleware, in favor of using new signals semt from edx-django-utils's MonitoringSupportMiddleware. +- Removes CodeOwnerMonitoringMiddleware, in favor of using new signals sent from edx-django-utils's MonitoringSupportMiddleware. + +Added +----- +* Adds search script datadog_search.py, for searching Datadog monitors and dashboards. [5.1.0] - 2024-11-21 ~~~~~~~~~~~~~~~~~~~~ diff --git a/edx_arch_experiments/datadog_monitoring/signals/handlers.py b/edx_arch_experiments/datadog_monitoring/signals/handlers.py index 77f8c7a..6be2e22 100644 --- a/edx_arch_experiments/datadog_monitoring/signals/handlers.py +++ b/edx_arch_experiments/datadog_monitoring/signals/handlers.py @@ -18,24 +18,24 @@ @receiver(monitoring_support_process_response, dispatch_uid=f"datadog_monitoring_support_process_response") -def datadog_monitoring_support_process_response(sender, **kwargs): +def datadog_monitoring_support_process_response(sender, request=None, **kwargs): """ Adds datadog monitoring at monitoring process response time. """ - if 'request' in kwargs: - set_code_owner_attribute(kwargs['request']) + if request: + set_code_owner_attribute(request) else: log.warning('monitoring_support_process_response sent without ' 'expected parameter: request.') @receiver(monitoring_support_process_exception, dispatch_uid=f"datadog_monitoring_support_process_exception") -def datadog_monitoring_support_process_exception(sender, **kwargs): +def datadog_monitoring_support_process_exception(sender, request=None, **kwargs): """ Adds datadog monitoring at monitoring process exception time. """ - if 'request' in kwargs: - set_code_owner_attribute(kwargs['request']) + if request: + set_code_owner_attribute(request) else: log.warning('monitoring_support_process_exception sent without ' 'expected parameter: request.') diff --git a/requirements/base.in b/requirements/base.in index 3a3af4f..ab4afac 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -3,7 +3,7 @@ celery # Asynchronous task execution library Django # Web application framework -edx_django_utils # Basic utilities for plugins, monitoring, and more +edx-django-utils>=7.1.0 # Basic utilities for plugins, monitoring, and more django-waffle # Configuration switches and flags -- used by config_watcher app edx-codejail # Actual codejail library; used by codejail_service app djangorestframework # Used by codejail_service app