Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Datadog monitoring for Dev - WIP #3837

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
web: python manage.py collectstatic --noinput && python manage.py migrate --noinput && gunicorn config.wsgi --bind 0.0.0.0:$PORT
app: python manage.py migrate --noinput && gunicorn config.wsgi --bind 0.0.0.0:$PORT
celery_worker: celery -A config worker -l DEBUG
celery_beat: celery -A config beat -l info -S django
web: python manage.py collectstatic --noinput && python manage.py migrate --noinput && ddtrace-run gunicorn config.wsgi --bind 0.0.0.0:$PORT
app: ./entrypoints/app.sh
celery_worker: ./entrypoints/celery-worker.sh
celery_beat: ./entrypoints/celery-beat.sh
1 change: 1 addition & 0 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
'wagtail_localize',
'wagtail_localize.locales',
'domestic_growth.apps.DomesticGrowthConfig',
'ddtrace.contrib.django',
]

MIDDLEWARE = [
Expand Down
13 changes: 13 additions & 0 deletions entrypoints/app.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

python manage.py migrate --noinput

if [[ "$COPILOT_ENVIRONMENT_NAME" == "dev" ]]; then
echo "Dev Environment Detected"
echo "$COPILOT_ENVIRONMENT_NAME"
ddtrace-run gunicorn config.wsgi --bind 0.0.0.0:$PORT
else
echo "Dev Environment Not Detected"
echo "$COPILOT_ENVIRONMENT_NAME"
gunicorn config.wsgi --bind 0.0.0.0:$PORT
fi
7 changes: 7 additions & 0 deletions entrypoints/celery-beat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

if [[ "$COPILOT_ENVIRONMENT_NAME" == "dev" ]]; then
ddtrace-run celery -A config beat -l info -S django
else
gunicorn celery -A config beat -l info -S django
fi
7 changes: 7 additions & 0 deletions entrypoints/celery-worker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

if [[ "$COPILOT_ENVIRONMENT_NAME" == "dev" ]]; then
ddtrace-run celery -A config worker -l DEBUG
else
celery -A config worker -l DEBUG
fi
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,4 @@ pydantic-settings==2.3.1
certifi==2024.7.4
python-bidi==0.4.2
elasticsearch==7.13.4
ddtrace==2.21.0
13 changes: 13 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ botocore==1.27.96
# via
# boto3
# s3transfer
bytecode==0.16.1
# via ddtrace
celery[redis]==5.3.6
# via
# -r requirements.in
Expand Down Expand Up @@ -101,6 +103,8 @@ dateparser==0.7.2
# via -r requirements.in
dbt-copilot-python==0.2.1
# via -r requirements.in
ddtrace==2.21.0
# via -r requirements.in
defusedxml==0.7.1
# via willow
deprecated==1.2.18
Expand Down Expand Up @@ -231,6 +235,8 @@ elastic-apm==6.1.3
# via -r requirements.in
elasticsearch==7.13.4
# via -r requirements.in
envier==0.6.1
# via ddtrace
et-xmlfile==2.0.0
# via openpyxl
events==0.5
Expand Down Expand Up @@ -335,6 +341,7 @@ opensearch-py==2.6.0
# opensearch-dsl
opentelemetry-api==1.22.0
# via
# ddtrace
# opentelemetry-distro
# opentelemetry-exporter-otlp-proto-grpc
# opentelemetry-exporter-otlp-proto-http
Expand Down Expand Up @@ -409,6 +416,7 @@ prompt-toolkit==3.0.50
# via click-repl
protobuf==4.25.6
# via
# ddtrace
# googleapis-common-protos
# opentelemetry-proto
psycopg2==2.9.9
Expand Down Expand Up @@ -557,6 +565,8 @@ tomli==2.2.1
typing-extensions==4.12.2
# via
# asgiref
# bytecode
# ddtrace
# dj-database-url
# kombu
# opentelemetry-sdk
Expand Down Expand Up @@ -640,10 +650,13 @@ willow[heif]==1.6.3
# willow
wrapt==1.17.2
# via
# ddtrace
# deprecated
# opentelemetry-instrumentation
xhtml2pdf==0.2.15
# via -r requirements.in
xmltodict==0.14.2
# via ddtrace
zipp==3.21.0
# via importlib-metadata

Expand Down
13 changes: 13 additions & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ browserstack-sdk==1.12.0
# via -r requirements_test.in
build==1.2.2.post1
# via pip-tools
bytecode==0.16.1
# via ddtrace
celery[redis]==5.3.6
# via
# -r requirements.in
Expand Down Expand Up @@ -143,6 +145,8 @@ dateparser==0.7.2
# -r requirements_test.in
dbt-copilot-python==0.2.1
# via -r requirements.in
ddtrace==2.21.0
# via -r requirements.in
decorator==5.1.1
# via
# ipdb
Expand Down Expand Up @@ -288,6 +292,8 @@ elastic-apm==6.1.3
# via -r requirements.in
elasticsearch==7.13.4
# via -r requirements.in
envier==0.6.1
# via ddtrace
et-xmlfile==2.0.0
# via openpyxl
events==0.5
Expand Down Expand Up @@ -486,6 +492,7 @@ opensearch-py==2.6.0
# opensearch-dsl
opentelemetry-api==1.22.0
# via
# ddtrace
# opentelemetry-distro
# opentelemetry-exporter-otlp-proto-grpc
# opentelemetry-exporter-otlp-proto-http
Expand Down Expand Up @@ -594,6 +601,7 @@ prompt-toolkit==3.0.50
# ipython
protobuf==4.25.6
# via
# ddtrace
# googleapis-common-protos
# opentelemetry-proto
psutil==7.0.0
Expand Down Expand Up @@ -863,6 +871,8 @@ typing-extensions==4.12.2
# asgiref
# astroid
# black
# bytecode
# ddtrace
# dj-database-url
# djlint
# ipython
Expand Down Expand Up @@ -964,12 +974,15 @@ willow[heif]==1.6.3
# willow
wrapt==1.17.2
# via
# ddtrace
# deprecated
# opentelemetry-instrumentation
wsproto==1.2.0
# via trio-websocket
xhtml2pdf==0.2.15
# via -r requirements.in
xmltodict==0.14.2
# via ddtrace
zipp==3.21.0
# via importlib-metadata
zope-event==5.0
Expand Down