From 4104b415ae274036f93a4b6ffada1c59ba65a00f Mon Sep 17 00:00:00 2001 From: Girum Bizuayehu Date: Mon, 25 Aug 2025 13:57:49 +0300 Subject: [PATCH] Remove datadog usages and references --- docker-compose.yml | 9 --------- docker/app/gunicorn_config.py | 5 ----- docker/app/run_dagster_daemon.sh | 6 +++--- docker/app/run_dagster_webserver.sh | 6 +++--- docker/app/run_django.sh | 4 ++-- env.example | 1 - hea/settings/base.py | 2 -- requirements/base.txt | 1 - 8 files changed, 8 insertions(+), 26 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 69ccff28..b431a29c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -108,13 +108,6 @@ services: AWS_ENDPOINT_URL_S3: ${MINIO_ENDPOINT_URL} SUPPORT_EMAIL_ADDRESS: ${SUPPORT_EMAIL_ADDRESS} DJANGO_MIGRATE: 1 - DD_TRACE_ENABLED: "false" - DD_TRACE_AGENT_URL: http://localhost:8126 - DD_DOGSTATSD_URL: udp://localhost:8125 - DD_SERVICE: app - DD_ENV: ${ENV} - DD_TAGS: app:${APP},env:{ENV} - DD_DJANGO_CACHE_SERVICE_NAME: django.core.cache KILUIGI_INTERMEDIATETARGET_BACKEND_CLASS: ${KILUIGI_INTERMEDIATETARGET_BACKEND_CLASS} KILUIGI_INTERMEDIATETARGET_ROOT_PATH: ${KILUIGI_INTERMEDIATETARGET_ROOT_PATH} KILUIGI_FINALTARGET_BACKEND_CLASS: ${KILUIGI_FINALTARGET_BACKEND_CLASS} @@ -134,7 +127,6 @@ services: - db environment: <<: *base_env - DD_SERVICE: dagster_webserver entrypoint: docker/app/run_dagster_webserver.sh x-aws-role: Statement: @@ -160,7 +152,6 @@ services: - db environment: <<: *base_env - DD_SERVICE: dagster_daemon entrypoint: docker/app/run_dagster_daemon.sh x-aws-role: Statement: diff --git a/docker/app/gunicorn_config.py b/docker/app/gunicorn_config.py index 3f122696..d0e2bc88 100644 --- a/docker/app/gunicorn_config.py +++ b/docker/app/gunicorn_config.py @@ -6,7 +6,6 @@ env = environ.Env( # set casting, default value - DD_TRACE_ENABLED=(bool, False), GUNICORN_PORT=(int, 8000), LOG_FORMATTER=(str, "standard"), ) @@ -24,9 +23,6 @@ limit_request_line = 0 # Set the access_log_format and handlers according to whether we are logging to DataDog access_handlers = ["logfile", "access_log"] -if env("DD_TRACE_ENABLED"): - access_handlers += ["console"] - statsd_host = env("DD_DOGSTATSD_URL").split("//")[1] # Gunicorn doesn't recognize the udp:// scheme # Set the access_log_format according to whether we are using a log processor like FluentD or DataDog if env("LOG_FORMATTER") == "json": access_log_format = '{ "time_local":"%(t)s", "remote_addr":"%(h)s", "request":"%(U)s", "query":"%(q)s", "request_method":"%(m)s", "status":%(s)s, "body_bytes_sent":%(B)d, "request_time":%(D)d, "http_user_agent":"%(a)s", "http_referrer":"%(f)s", "x_forwarded_for": "%({X-Forwarded-For}i)s"}' # NOQA @@ -87,7 +83,6 @@ "level": "DEBUG", "propagate": False, }, - "ddtrace": {"level": "INFO", "propagate": False}, "environ": {"level": "INFO", "propagate": False}, "fiona": {"level": "INFO", "propagate": False}, "rasterio": {"level": "INFO", "propagate": False}, diff --git a/docker/app/run_dagster_daemon.sh b/docker/app/run_dagster_daemon.sh index 08cfe07e..8beac63a 100755 --- a/docker/app/run_dagster_daemon.sh +++ b/docker/app/run_dagster_daemon.sh @@ -1,7 +1,7 @@ #!/bin/bash # Wait up to 30 minutes for outstanding migrations to finish running on another container, checking every 30 seconds -for i in `seq 1 60`; do +for i in $(seq 1 60); do ./manage.py migrate --plan | grep "No planned migration operations." && break echo Waiting for outstanding database migrations sleep 30 @@ -13,5 +13,5 @@ echo Setting up logs touch log/django.log chown -R django:django log/* -echo Starting Dagster with ddtrace to ${DD_TRACE_AGENT_URL} -gosu django ddtrace-run dagster-daemon run $* \ No newline at end of file +echo Starting Dagster +gosu django dagster-daemon run $* \ No newline at end of file diff --git a/docker/app/run_dagster_webserver.sh b/docker/app/run_dagster_webserver.sh index ad57e743..e6b55a19 100755 --- a/docker/app/run_dagster_webserver.sh +++ b/docker/app/run_dagster_webserver.sh @@ -1,7 +1,7 @@ #!/bin/bash # Wait up to 30 minutes for outstanding migrations to finish running on another container, checking every 30 seconds -for i in `seq 1 60`; do +for i in $(seq 1 60); do ./manage.py migrate --plan | grep "No planned migration operations." && break echo Waiting for outstanding database migrations sleep 30 @@ -13,5 +13,5 @@ echo Setting up logs touch log/django.log chown -R django:django log/* -echo Starting Dagster with ddtrace to ${DD_TRACE_AGENT_URL} -gosu django ddtrace-run dagster-webserver -h 0.0.0.0 -p 3000 -m pipelines --path-prefix /${DAGSTER_WEBSERVER_PREFIX} $* \ No newline at end of file +echo Starting Dagster +gosu django dagster-webserver -h 0.0.0.0 -p 3000 -m pipelines --path-prefix /${DAGSTER_WEBSERVER_PREFIX} $* \ No newline at end of file diff --git a/docker/app/run_django.sh b/docker/app/run_django.sh index 7384901a..73112fa1 100755 --- a/docker/app/run_django.sh +++ b/docker/app/run_django.sh @@ -39,8 +39,8 @@ touch log/django.log touch log/django_sql.log chown -R django:django log/* -echo Starting Gunicorn with DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE} and ddtrace to ${DD_TRACE_AGENT_URL} -gosu django ddtrace-run gunicorn ${APP}.wsgi:application \ +echo Starting Gunicorn with DJANGO_SETTINGS_MODULE=${DJANGO_SETTINGS_MODULE} +gosu django gunicorn ${APP}.wsgi:application \ --name ${APP}${ENV} \ --config $(dirname $(readlink -f "$0"))/gunicorn_config.py \ $* 2>&1 diff --git a/env.example b/env.example index 53463946..4bc8c408 100644 --- a/env.example +++ b/env.example @@ -28,7 +28,6 @@ MINIO_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY MINIO_ENDPOINT_URL=http://minio:9000 # change to http://localhost:9000 if using a local environment SUPPORT_EMAIL_ADDRESS=helpdesk@fews.net PIP_INDEX_URL=https://pypi.python.org/simple/ -DD_TRACE_ENABLED=False # Google API related settings # GOOGLE_APPLICATION_CREDENTIALS = '{ diff --git a/hea/settings/base.py b/hea/settings/base.py index 9c5430eb..dd7a83dc 100644 --- a/hea/settings/base.py +++ b/hea/settings/base.py @@ -106,7 +106,6 @@ "django.contrib.admindocs", "binary_database_files", "django_extensions", - "ddtrace.contrib.django", "rest_framework_gis", ] PROJECT_APPS = ["common", "metadata", "baseline"] @@ -259,7 +258,6 @@ }, }, "loggers": { - "ddtrace": {"handlers": ["logfile"], "level": "INFO"}, "django.request": {"handlers": ["console", "logfile"], "level": "INFO", "propagate": False}, "django.db.backends": {"handlers": ["console", "logfile"], "level": "INFO", "propagate": False}, "django.security": {"handlers": ["console", "logfile"], "level": "ERROR", "propagate": False}, diff --git a/requirements/base.txt b/requirements/base.txt index 20885195..255ca315 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -4,7 +4,6 @@ dagster_aws==0.22.8 dagster-pipes==1.6.8 dagster-postgres==0.22.8 dagster-webserver==1.6.8 -ddtrace==2.6.2 Django==5.1.4 django-binary-database-files==1.0.18 django-environ==0.11.2