Skip to content

Commit

Permalink
BE: remove ddtrace
Browse files Browse the repository at this point in the history
  • Loading branch information
andreipradan committed Nov 30, 2024
1 parent 23eed2f commit 3066954
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 33 deletions.
6 changes: 1 addition & 5 deletions deploy/services/backend.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ Description=django backend server

[Service]
User=rpi
Environment=DD_ENV=raspberry
Environment=DD_LOGS_INJECTION=true
Environment=DD_SERVICE=mainframe
Environment=DD_TRACE_DJANGO_ENABLED=true
ExecStart=/home/rpi/projects/.virtualenvs/mainframe/bin/ddtrace-run /home/rpi/projects/.virtualenvs/mainframe/bin/gunicorn -b 0:7777 --workers 3 mainframe.core.wsgi
ExecStart=/home/rpi/projects/.virtualenvs/mainframe/bin/gunicorn -b 0:7777 --workers 3 mainframe.core.wsgi
ExecStartPost=/home/rpi/projects/.virtualenvs/mainframe/bin/python mainframe/clients/chat.py [[backend]] up
ExecStopPost=/home/rpi/projects/.virtualenvs/mainframe/bin/python mainframe/clients/chat.py [[backend]] down
Restart=on-success
Expand Down
2 changes: 1 addition & 1 deletion deploy/services/bot.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Environment=DD_ENV=raspberry
Environment=DD_LOGS_INJECTION=true
Environment=DD_SERVICE=mainframe
Environment=DD_TRACE_DJANGO_ENABLED=true
ExecStart=/home/rpi/projects/.virtualenvs/mainframe/bin/ddtrace-run /home/rpi/projects/.virtualenvs/mainframe/bin/python manage.py run_bot_polling
ExecStart=/home/rpi/projects/.virtualenvs/mainframe/bin/python manage.py run_bot_polling
ExecStartPost=/home/rpi/projects/.virtualenvs/mainframe/bin/python mainframe/clients/chat.py [[bot]] up
ExecStopPost=/home/rpi/projects/.virtualenvs/mainframe/bin/python mainframe/clients/chat.py [[bot]] down
Restart=on-success
Expand Down
4 changes: 2 additions & 2 deletions deploy/services/huey.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Environment=DD_ENV=raspberry
Environment=DD_LOGS_INJECTION=true
Environment=DD_SERVICE=mainframe
Environment=DD_TRACE_DJANGO_ENABLED=true
ExecStart=/home/rpi/projects/.virtualenvs/mainframe/bin/ddtrace-run /home/rpi/projects/.virtualenvs/mainframe/bin/python manage.py run_huey -w 4
ExecStartPost=/home/rpi/projects/.virtualenvs/mainframe/bin/ddtrace-run /home/rpi/projects/.virtualenvs/mainframe/bin/python manage.py set_tasks
ExecStart=/home/rpi/projects/.virtualenvs/mainframe/bin/python manage.py run_huey -w 4
ExecStartPost=/home/rpi/projects/.virtualenvs/mainframe/bin/python manage.py set_tasks
ExecStopPost=/home/rpi/projects/.virtualenvs/mainframe/bin/python mainframe/clients/chat.py [[huey]] down
Restart=on-success
WorkingDirectory=/home/rpi/projects/mainframe/src
Expand Down
2 changes: 1 addition & 1 deletion deploy/services/quiz.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Environment=DD_ENV=raspberry
Environment=DD_LOGS_INJECTION=true
Environment=DD_SERVICE=mainframe
Environment=DD_TRACE_DJANGO_ENABLED=true
ExecStart=/home/rpi/projects/.virtualenvs/mainframe/bin/ddtrace-run /home/rpi/projects/.virtualenvs/mainframe/bin/python manage.py run_quiz_bot_polling
ExecStart=/home/rpi/projects/.virtualenvs/mainframe/bin/python manage.py run_quiz_bot_polling
ExecStartPost=/home/rpi/projects/.virtualenvs/mainframe/bin/python mainframe/clients/chat.py [[quiz]] up
ExecStopPost=/home/rpi/projects/.virtualenvs/mainframe/bin/python mainframe/clients/chat.py [[quiz]] down
Restart=on-success
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dependencies = [
"dnspython>=2.6.0rc1",
"sqlparse>=0.5.0",
"defusedxml>=0.7.1",
"ddtrace>=2.17.2",
]
readme = "README.md"
requires-python = ">= 3.10"
Expand Down
11 changes: 0 additions & 11 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ attrs==23.2.0
# via aiohttp
beautifulsoup4==4.11.1
black==24.4.2
bytecode==0.16.0
# via ddtrace
cachetools==4.2.2
# via google-auth
certifi==2024.2.2
Expand All @@ -49,7 +47,6 @@ coverage==7.5.0
# via pytest-cov
cryptography==42.0.5
# via pyjwt
ddtrace==2.17.2
decorator==5.1.1
# via ipython
defusedxml==0.7.1
Expand All @@ -70,8 +67,6 @@ django-environ==0.9.0
django-extensions==3.2.1
djangorestframework==3.14.0
dnspython==2.6.1
envier==0.6.1
# via ddtrace
et-xmlfile==1.1.0
# via openpyxl
exceptiongroup==1.2.1
Expand Down Expand Up @@ -172,7 +167,6 @@ nodeenv==1.9.0
# via pre-commit
openpyxl==3.1.2
opentelemetry-api==1.24.0
# via ddtrace
# via opentelemetry-exporter-otlp-proto-http
# via opentelemetry-instrumentation
# via opentelemetry-instrumentation-django
Expand Down Expand Up @@ -231,7 +225,6 @@ proto-plus==1.23.0
# via google-ai-generativelanguage
# via google-api-core
protobuf==4.25.3
# via ddtrace
# via google-ai-generativelanguage
# via google-api-core
# via google-generativeai
Expand Down Expand Up @@ -332,7 +325,6 @@ typing-extensions==4.11.0
# via anyio
# via asgiref
# via black
# via ddtrace
# via google-generativeai
# via ipython
# via logfire
Expand All @@ -351,11 +343,8 @@ virtualenv==20.26.2
wcwidth==0.2.13
# via prompt-toolkit
wrapt==1.16.0
# via ddtrace
# via deprecated
# via opentelemetry-instrumentation
xmltodict==0.14.2
# via ddtrace
yarl==1.9.4
# via aiohttp
yeelight==0.7.10
Expand Down
11 changes: 0 additions & 11 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ async-timeout==4.0.3
attrs==23.2.0
# via aiohttp
beautifulsoup4==4.11.1
bytecode==0.16.0
# via ddtrace
cachetools==4.2.2
# via google-auth
certifi==2024.2.2
Expand All @@ -40,7 +38,6 @@ charset-normalizer==3.3.2
# via requests
cryptography==42.0.5
# via pyjwt
ddtrace==2.17.2
defusedxml==0.7.1
deprecated==1.2.14
# via opentelemetry-api
Expand All @@ -55,8 +52,6 @@ django-environ==0.9.0
django-extensions==3.2.1
djangorestframework==3.14.0
dnspython==2.6.1
envier==0.6.1
# via ddtrace
et-xmlfile==1.1.0
# via openpyxl
exceptiongroup==1.2.2
Expand Down Expand Up @@ -136,7 +131,6 @@ multidict==6.0.5
# via yarl
openpyxl==3.1.2
opentelemetry-api==1.24.0
# via ddtrace
# via opentelemetry-exporter-otlp-proto-http
# via opentelemetry-instrumentation
# via opentelemetry-instrumentation-django
Expand Down Expand Up @@ -179,7 +173,6 @@ proto-plus==1.23.0
# via google-ai-generativelanguage
# via google-api-core
protobuf==4.25.3
# via ddtrace
# via google-ai-generativelanguage
# via google-api-core
# via google-generativeai
Expand Down Expand Up @@ -249,7 +242,6 @@ tqdm==4.66.5
typing-extensions==4.11.0
# via anyio
# via asgiref
# via ddtrace
# via google-generativeai
# via logfire
# via opentelemetry-sdk
Expand All @@ -263,11 +255,8 @@ urllib3==1.26.18
# via requests
# via sentry-sdk
wrapt==1.16.0
# via ddtrace
# via deprecated
# via opentelemetry-instrumentation
xmltodict==0.14.2
# via ddtrace
yarl==1.9.4
# via aiohttp
yeelight==0.7.10
Expand Down
3 changes: 2 additions & 1 deletion src/mainframe/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
BASE_DIR = Path(__file__).resolve().parent.parent
environ.Env.read_env(os.path.join(BASE_DIR, ".env"))

ENV = env("ENV", default=None)
DEBUG = int(env("DEBUG", default=0))

# Quick-start development settings - unsuitable for production
Expand Down Expand Up @@ -231,7 +232,7 @@
"DEFAULT_CREDIT_ACCOUNT_CLIENT_CODE", default=None
)

if (ENV := env("ENV", default=None)) in ["local", "prod", "rpi"]:
if ENV in ["local", "prod", "rpi"]:
if ENV == "local":
INSTALLED_APPS += ["debug_toolbar"]
MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]
Expand Down

0 comments on commit 3066954

Please sign in to comment.