Skip to content

Commit

Permalink
feat: Allow per-service Datadog APM enable for edxapp (#8)
Browse files Browse the repository at this point in the history
This will allow us to enable Datadog for edxapp independently of other
services during the migration. It also pushes the knowledge of the two
common switches into the defaults layer so that only one variable needs to
be consulted. Similar work for other services would follow.

I've also switched to a topic-first rather than an `ENABLE`-first
naming convention since it tends to sort and group better.

This supports edx/edx-arch-experiments#632
  • Loading branch information
timmc-edx committed May 14, 2024
1 parent 01d773f commit 4942912
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions playbooks/roles/edxapp/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ EDXAPP_NEWRELIC_WORKERS_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT
EDXAPP_LMS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false
EDXAPP_CMS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false
EDXAPP_WORKERS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false
EDXAPP_DATADOG_ENABLE: "{{COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP}}"

EDXAPP_ORA2_FILE_PREFIX: '{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}/ora2'
EDXAPP_FILE_UPLOAD_STORAGE_BUCKET_NAME: '{{ EDXAPP_AWS_STORAGE_BUCKET_NAME }}'
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/edxapp/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
- install:app-requirements

- name: "Install Datadog APM requirements"
when: COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP
when: EDXAPP_DATADOG_ENABLE
pip:
name:
- ddtrace
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi
export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}"
{% endif -%}

{% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %}
{% if EDXAPP_DATADOG_ENABLE %}
{% set executable = edxapp_venv_bin + '/ddtrace-run ' + executable %}
export DD_TAGS="service:edx-edxapp-cms"
export DD_DJANGO_USE_LEGACY_RESOURCE_FORMAT=true
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fi
export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}"
{% endif -%}

{% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %}
{% if EDXAPP_DATADOG_ENABLE %}
{% set executable = edxapp_venv_bin + '/ddtrace-run ' + executable %}
export DD_TAGS="service:edx-edxapp-lms"
export DD_DJANGO_USE_LEGACY_RESOURCE_FORMAT=true
Expand Down

0 comments on commit 4942912

Please sign in to comment.