From 7ffbc532861af3eb16c2b4d3ba3ba933bc1ba692 Mon Sep 17 00:00:00 2001 From: jansenk Date: Tue, 11 Jun 2024 12:13:54 -0400 Subject: [PATCH] feat: allow xqwatcher dd to be intependently toggled --- playbooks/roles/xqwatcher/defaults/main.yml | 2 ++ playbooks/roles/xqwatcher/tasks/deploy_watcher.yml | 2 +- .../templates/edx/app/supervisor/conf.d/xqwatcher.conf.j2 | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/xqwatcher/defaults/main.yml b/playbooks/roles/xqwatcher/defaults/main.yml index 9797e0c3989..d32a43fa0ea 100644 --- a/playbooks/roles/xqwatcher/defaults/main.yml +++ b/playbooks/roles/xqwatcher/defaults/main.yml @@ -76,6 +76,8 @@ XQWATCHER_NEWRELIC_APPNAME: "{{ COMMON_DEPLOYMENT }}-{{ COMMON_ENVIRONMENT }}-xq XQWATCHER_PIP_EXTRA_ARGS: "-i {{ COMMON_PYPI_MIRROR_URL }}" XQWATCHER_DATADOG_APPNAME: "edx-{{ xqwatcher_service_name }}" +XQWATCHER_DATADOG_ENABLED: "{{COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP}}" + # # # vars are namespace with the module name. diff --git a/playbooks/roles/xqwatcher/tasks/deploy_watcher.yml b/playbooks/roles/xqwatcher/tasks/deploy_watcher.yml index e9a13e29113..af30337a702 100644 --- a/playbooks/roles/xqwatcher/tasks/deploy_watcher.yml +++ b/playbooks/roles/xqwatcher/tasks/deploy_watcher.yml @@ -15,7 +15,7 @@ - install:app-requirements - name: "Install Datadog APM requirements" - when: COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP + when: XQWATCHER_DATADOG_ENABLED pip: name: - ddtrace diff --git a/playbooks/roles/xqwatcher/templates/edx/app/supervisor/conf.d/xqwatcher.conf.j2 b/playbooks/roles/xqwatcher/templates/edx/app/supervisor/conf.d/xqwatcher.conf.j2 index 3429d9ce643..f1682f7f1a7 100644 --- a/playbooks/roles/xqwatcher/templates/edx/app/supervisor/conf.d/xqwatcher.conf.j2 +++ b/playbooks/roles/xqwatcher/templates/edx/app/supervisor/conf.d/xqwatcher.conf.j2 @@ -8,7 +8,7 @@ {% else %} {% set executable = xqwatcher_venv_dir + '/bin/python' %} {% endif %} -{% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %} +{% if XQWATCHER_DATADOG_ENABLED %} {% set executable = xqwatcher_venv_dir + '/bin/ddtrace-run ' + executable %} {% endif -%} @@ -21,6 +21,6 @@ stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log # Copied DD_TRACE_LOG_STREAM_HANDLER config from edx_django_service. This is required # to disable Datadog trace debug logging. -environment={% if COMMON_ENABLE_NEWRELIC_APP %}NEW_RELIC_APP_NAME={{ XQWATCHER_NEWRELIC_APPNAME }},NEW_RELIC_LICENSE_KEY={{ NEWRELIC_LICENSE_KEY }},{% endif -%}{% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %}DD_DJANGO_USE_HANDLER_RESOURCE_FORMAT=true,DD_TAGS="service:{{ XQWATCHER_DATADOG_APPNAME }} version:{{ app_version }}",DD_TRACE_LOG_STREAM_HANDLER=false,DD_PROFILING_ENABLED=true,DD_DATA_STREAMS_ENABLED=true,{% endif -%} +environment={% if COMMON_ENABLE_NEWRELIC_APP %}NEW_RELIC_APP_NAME={{ XQWATCHER_NEWRELIC_APPNAME }},NEW_RELIC_LICENSE_KEY={{ NEWRELIC_LICENSE_KEY }},{% endif -%}{% if XQWATCHER_DATADOG_ENABLED %}DD_DJANGO_USE_HANDLER_RESOURCE_FORMAT=true,DD_TAGS="service:{{ XQWATCHER_DATADOG_APPNAME }} version:{{ app_version }}",DD_TRACE_LOG_STREAM_HANDLER=false,DD_PROFILING_ENABLED=true,DD_DATA_STREAMS_ENABLED=true,{% endif -%} killasgroup=true stopasgroup=true