From 5ec8737856038069a419d11112063dfc1985113d Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 14 Dec 2023 12:12:09 -0500 Subject: [PATCH] chore: Remove old datadog related settings. Datadog was removed 6+ years ago but some settings and related keys got left behind. Get rid of them since we don't need them and also to prevent people from assuming it's okay to hardcode datadog settings into our codebase. --- cms/envs/production.py | 8 -------- lms/djangoapps/courseware/user_state_client.py | 3 --- lms/envs/production.py | 8 -------- .../django_comment_common/comment_client/thread.py | 6 ------ xmodule/x_module.py | 3 --- 5 files changed, 28 deletions(-) diff --git a/cms/envs/production.py b/cms/envs/production.py index fb396f9e3d..2ac80b94c3 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -411,14 +411,6 @@ BLOCKSTORE_API_URL = ENV_TOKENS.get('BLOCKSTORE_API_URL', None) # e.g. "https:/ # Configure an API auth token at (blockstore URL)/admin/authtoken/token/ BLOCKSTORE_API_AUTH_TOKEN = AUTH_TOKENS.get('BLOCKSTORE_API_AUTH_TOKEN', None) -# Datadog for events! -DATADOG = AUTH_TOKENS.get("DATADOG", {}) -DATADOG.update(ENV_TOKENS.get("DATADOG", {})) - -# TODO: deprecated (compatibility with previous settings) -if 'DATADOG_API' in AUTH_TOKENS: - DATADOG['api_key'] = AUTH_TOKENS['DATADOG_API'] - # Celery Broker CELERY_ALWAYS_EAGER = ENV_TOKENS.get("CELERY_ALWAYS_EAGER", False) CELERY_BROKER_TRANSPORT = ENV_TOKENS.get("CELERY_BROKER_TRANSPORT", "") diff --git a/lms/djangoapps/courseware/user_state_client.py b/lms/djangoapps/courseware/user_state_client.py index 63dcd9da14..b893200c21 100644 --- a/lms/djangoapps/courseware/user_state_client.py +++ b/lms/djangoapps/courseware/user_state_client.py @@ -240,9 +240,6 @@ class DjangoXBlockUserStateClient(XBlockUserStateClient): even though the actual stored state in the database will be ``"{}"``). """ - # Use this sample rate for DataDog events. - API_DATADOG_SAMPLE_RATE = 0.1 - class ServiceUnavailable(XBlockUserStateClient.ServiceUnavailable): """ This error is raised if the service backing this client is currently unavailable. diff --git a/lms/envs/production.py b/lms/envs/production.py index a50dedf906..45accf0c4a 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -525,14 +525,6 @@ BLOCKSTORE_API_URL = ENV_TOKENS.get('BLOCKSTORE_API_URL', None) # e.g. "https:/ # Configure an API auth token at (blockstore URL)/admin/authtoken/token/ BLOCKSTORE_API_AUTH_TOKEN = AUTH_TOKENS.get('BLOCKSTORE_API_AUTH_TOKEN', None) -# Datadog for events! -DATADOG = AUTH_TOKENS.get("DATADOG", {}) -DATADOG.update(ENV_TOKENS.get("DATADOG", {})) - -# TODO: deprecated (compatibility with previous settings) -if 'DATADOG_API' in AUTH_TOKENS: - DATADOG['api_key'] = AUTH_TOKENS['DATADOG_API'] - # Analytics API ANALYTICS_API_KEY = AUTH_TOKENS.get("ANALYTICS_API_KEY", ANALYTICS_API_KEY) ANALYTICS_API_URL = ENV_TOKENS.get("ANALYTICS_API_URL", ANALYTICS_API_URL) diff --git a/openedx/core/djangoapps/django_comment_common/comment_client/thread.py b/openedx/core/djangoapps/django_comment_common/comment_client/thread.py index 6f92313b6e..8122f96f22 100644 --- a/openedx/core/djangoapps/django_comment_common/comment_client/thread.py +++ b/openedx/core/djangoapps/django_comment_common/comment_client/thread.py @@ -30,12 +30,6 @@ class Thread(models.Model): 'close_reason_code', 'edit_reason_code', 'closing_user_id', 'editing_user_id', ] - # metric_tag_fields are used by Datadog to record metrics about the model - metric_tag_fields = [ - 'course_id', 'group_id', 'pinned', 'closed', 'anonymous', 'anonymous_to_peers', - 'endorsed', 'read', - ] - # initializable_fields are sent in POST requests initializable_fields = updatable_fields + ['thread_type', 'context'] diff --git a/xmodule/x_module.py b/xmodule/x_module.py index fd974c6928..73588d7cf2 100644 --- a/xmodule/x_module.py +++ b/xmodule/x_module.py @@ -56,9 +56,6 @@ XMODULE_METRIC_NAME = 'edxapp.xmodule' XMODULE_DURATION_METRIC_NAME = XMODULE_METRIC_NAME + '.duration' XMODULE_METRIC_SAMPLE_RATE = 0.1 -# Stats event sent to DataDog in order to determine if old XML parsing can be deprecated. -DEPRECATION_VSCOMPAT_EVENT = 'deprecation.vscompat' - # xblock view names # This is the view that will be rendered to display the XBlock in the LMS.