Skip to content

Commit 5bde1ec

Browse files
committed
feat: REV-4051 | allow edx_django_service to be provided with specific app names to run datadog on
fix: interpolation for DD installation conditional. also formatting fix: Apply suggestions from code review Co-authored-by: Tim McCormack <[email protected]> fix: update variable name fix: update j2 file with new conditional
1 parent ee5d9a3 commit 5bde1ec

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

playbooks/roles/common_vars/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ COMMON_MONGO_READ_ONLY_PASS: !!null
102102
COMMON_ENABLE_DATADOG: False
103103
# Enable APM monitoring with Datadog (metrics, traces, and logs)
104104
COMMON_ENABLE_DATADOG_APP: False
105+
COMMON_ENABLE_DATADOG_APP_SERVICES: []
105106
COMMON_ENABLE_NGINXTRA: False
106107
COMMON_ENABLE_SPLUNKFORWARDER: False
107108
COMMON_ENABLE_NEWRELIC: False

playbooks/roles/edx_django_service/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ edx_django_service_basic_auth_exempted_paths: '{{ edx_django_service_basic_auth_
104104
edx_django_service_newrelic_appname: '{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ edx_django_service_name }}'
105105
edx_django_service_enable_newrelic_distributed_tracing: false
106106
edx_django_datadog_service: 'edx-{{ edx_django_service_name }}'
107+
edx_django_service_datadog_enable: '{{ COMMON_ENABLE_DATADOG and (COMMON_ENABLE_DATADOG_APP or edx_django_service_name in COMMON_ENABLE_DATADOG_APP_SERVICES }}'
107108

108109
edx_django_service_repos:
109110
- PROTOCOL: '{{ edx_django_service_git_protocol }}'

playbooks/roles/edx_django_service/tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@
213213
- install:app-requirements
214214

215215
- name: "Install Datadog APM requirements"
216-
when: COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP
216+
when: >
217+
COMMON_ENABLE_DATADOG and
218+
(COMMON_ENABLE_DATADOG_APP or edx_django_service_datadog_enable)
217219
pip:
218220
name:
219221
- ddtrace

playbooks/roles/edx_django_service/templates/edx/app/app/app.sh.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fi
2020
export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}"
2121
{% endif -%}
2222

23-
{% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %}
23+
{% if COMMON_ENABLE_DATADOG and (COMMON_ENABLE_DATADOG_APP or edx_django_service_datadog_enable) %}
2424
{% set executable = edx_django_service_venv_bin + '/ddtrace-run ' + executable %}
2525
export DD_TAGS="service:{{ edx_django_datadog_service }}"
2626
export DD_DJANGO_USE_HANDLER_RESOURCE_FORMAT=true

0 commit comments

Comments
 (0)