From a84e44ea6434548e5661107dc7953559e0dc5d86 Mon Sep 17 00:00:00 2001 From: connorhaugh <49422820+connorhaugh@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:06:45 -0400 Subject: [PATCH 1/4] feat: add dd to celery --- ecommerce/celery_app.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ecommerce/celery_app.py b/ecommerce/celery_app.py index 967a02de8df..154f2e92f47 100644 --- a/ecommerce/celery_app.py +++ b/ecommerce/celery_app.py @@ -4,6 +4,19 @@ from celery import Celery + +# TEMP: This code will be removed by ARCH-BOM on 4/22/24 +# ddtrace allows celery task logs to be traced by the dd agent. +# TODO: remove this code. +try: + from ddtrace import patch +except ImportError: + pass +try: + patch(celery=True) +except NameError: + pass + # Set the default configuration module, if one is not aleady defined. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ecommerce.settings.local') From 9834599a03e247e32f5c6ba17e74b4e6478af7f4 Mon Sep 17 00:00:00 2001 From: connorhaugh <49422820+connorhaugh@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:21:55 -0400 Subject: [PATCH 2/4] fix: spacing --- ecommerce/celery_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ecommerce/celery_app.py b/ecommerce/celery_app.py index 154f2e92f47..9210a7d0b61 100644 --- a/ecommerce/celery_app.py +++ b/ecommerce/celery_app.py @@ -1,10 +1,10 @@ import os - from celery import Celery + # TEMP: This code will be removed by ARCH-BOM on 4/22/24 # ddtrace allows celery task logs to be traced by the dd agent. # TODO: remove this code. From 4f53cae29cd0dcf561ca591830f0dfe91b242426 Mon Sep 17 00:00:00 2001 From: connorhaugh <49422820+connorhaugh@users.noreply.github.com> Date: Mon, 22 Apr 2024 14:34:09 -0400 Subject: [PATCH 3/4] fix: import order --- ecommerce/celery_app.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ecommerce/celery_app.py b/ecommerce/celery_app.py index 9210a7d0b61..0b03de9b53a 100644 --- a/ecommerce/celery_app.py +++ b/ecommerce/celery_app.py @@ -1,8 +1,6 @@ - -import os from celery import Celery - +import os # TEMP: This code will be removed by ARCH-BOM on 4/22/24 From 460c2f0128762ad71c02ae5612a2787b1c8ef1f4 Mon Sep 17 00:00:00 2001 From: connorhaugh <49422820+connorhaugh@users.noreply.github.com> Date: Mon, 22 Apr 2024 16:17:16 -0400 Subject: [PATCH 4/4] fix: lint --- ecommerce/celery_app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ecommerce/celery_app.py b/ecommerce/celery_app.py index 0b03de9b53a..1da9e0755b4 100644 --- a/ecommerce/celery_app.py +++ b/ecommerce/celery_app.py @@ -1,7 +1,6 @@ - -from celery import Celery import os +from celery import Celery # TEMP: This code will be removed by ARCH-BOM on 4/22/24 # ddtrace allows celery task logs to be traced by the dd agent.