From 42db04363cf318552688a0ff9414911c41d2aaca Mon Sep 17 00:00:00 2001 From: Chris Pappas Date: Thu, 23 May 2024 14:20:23 -0400 Subject: [PATCH] feat: add plumbing for ecomworker prod DD to be turned on (#17) * feat: add plumbing for ecomworker prod DD to be turned on * fix: set default to check common vars --- playbooks/roles/ecomworker/defaults/main.yml | 3 +++ playbooks/roles/ecomworker/tasks/main.yml | 2 +- .../ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/ecomworker/defaults/main.yml b/playbooks/roles/ecomworker/defaults/main.yml index 575df70021c..59bae85240c 100644 --- a/playbooks/roles/ecomworker/defaults/main.yml +++ b/playbooks/roles/ecomworker/defaults/main.yml @@ -28,6 +28,9 @@ ECOMMERCE_WORKER_REPOS: ECOMMERCE_WORKER_NEWRELIC_APPNAME: '{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ ecommerce_worker_service_name }}' ECOMMERCE_WORKER_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false +# Datadog +ECOMMERCE_WORKER_DATADOG_ENABLE: "{{COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP}}" + # CELERY ECOMMERCE_WORKER_BROKER_USERNAME: '' ECOMMERCE_WORKER_BROKER_PASSWORD: 'celery' diff --git a/playbooks/roles/ecomworker/tasks/main.yml b/playbooks/roles/ecomworker/tasks/main.yml index e68de294d29..ec85c990c34 100644 --- a/playbooks/roles/ecomworker/tasks/main.yml +++ b/playbooks/roles/ecomworker/tasks/main.yml @@ -22,7 +22,7 @@ - install:app-requirements - name: "Install Datadog APM requirements" - when: COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP + when: ECOMMERCE_WORKER_DATADOG_ENABLE pip: name: - ddtrace diff --git a/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 b/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 index 04281dedb76..ddd621424e7 100644 --- a/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 +++ b/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 @@ -14,7 +14,7 @@ export NEW_RELIC_APP_NAME='{{ ECOMMERCE_WORKER_NEWRELIC_APPNAME }}' export NEW_RELIC_LICENSE_KEY='{{ NEWRELIC_LICENSE_KEY }}' {% endif -%} -{% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %} +{% if ECOMMERCE_WORKER_DATADOG_ENABLE %} {% set executable = ecommerce_worker_venv_bin + '/ddtrace-run ' + executable %} export DD_TAGS="service:edx-{{ ecommerce_worker_service_name }} version:{{ app_version }}" export DD_DJANGO_USE_HANDLER_RESOURCE_FORMAT=true