Skip to content

Commit

Permalink
Merge pull request #85 from edx/diana/add-dd-profiling
Browse files Browse the repository at this point in the history
feat: Add variables to enable DD profiling.
  • Loading branch information
dianakhuang authored Oct 24, 2024
2 parents bd2b1d9 + 3108b7e commit 60de821
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions playbooks/roles/common_vars/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ COMMON_ENABLE_DATADOG: False
# Enable APM monitoring with Datadog (metrics, traces, and logs)
COMMON_ENABLE_DATADOG_APP: False
COMMON_ENABLE_DATADOG_APP_SERVICES: []
COMMON_ENABLE_DATADOG_PROFILING: False
COMMON_ENABLE_NGINXTRA: False
COMMON_ENABLE_SPLUNKFORWARDER: False
COMMON_ENABLE_NEWRELIC: False
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/edxapp/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ EDXAPP_XML_S3_BUCKET: !!null
EDXAPP_XML_S3_KEY: !!null

EDXAPP_DATADOG_ENABLE: "{{COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP}}"
EDXAPP_DATADOG_PROFILING_ENABLE: "{{EDXAPP_DATADOG_ENABLE and COMMON_ENABLE_DATADOG_PROFILING}}"
# ddtrace 2.7.9 contains a fix for a pymongo incompatibility.
# (Same fix is present in 2.8.2 on the 2.8.x release line.)
EDXAPP_DDTRACE_PIP_SPEC: 'ddtrace>=2.7.9'
Expand Down
5 changes: 5 additions & 0 deletions playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ export DD_TRACE_LOG_STREAM_HANDLER=false
export DD_DJANGO_INSTRUMENT_MIDDLEWARE=false
{% endif -%}

# We want to be able to toggle this on separately from DD in general.
{% if EDXAPP_DATADOG_PROFILING_ENABLE %}
export DD_PROFILING_ENABLED=true
{% endif -%}

export PORT="{{ edxapp_cms_gunicorn_port }}"
export ADDRESS="{{ edxapp_cms_gunicorn_host }}"
export LANG="{{ EDXAPP_LANG }}"
Expand Down
5 changes: 5 additions & 0 deletions playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export DD_DJANGO_INSTRUMENT_MIDDLEWARE=false

{% endif -%}

# We want to be able to toggle this on separately from DD in general.
{% if EDXAPP_DATADOG_PROFILING_ENABLE %}
export DD_PROFILING_ENABLED=true
{% endif -%}

export PORT="{{ edxapp_lms_gunicorn_port }}"
export ADDRESS="{{ edxapp_lms_gunicorn_host }}"
export LANG="{{ EDXAPP_LANG }}"
Expand Down
4 changes: 4 additions & 0 deletions playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ export DD_TRACE_LOG_STREAM_HANDLER=false
export DD_DJANGO_INSTRUMENT_MIDDLEWARE=false
{% endif -%}

# We want to be able to toggle this on separately from DD in general.
{% if EDXAPP_DATADOG_PROFILING_ENABLE %}
export DD_PROFILING_ENABLED=true
{% endif -%}

# We exec so that celery is the child of supervisor and can be managed properly

Expand Down

0 comments on commit 60de821

Please sign in to comment.