Skip to content

Commit

Permalink
feat: allow xqwatcher dd to be intependently toggled
Browse files Browse the repository at this point in the history
  • Loading branch information
jansenk committed Jun 11, 2024
1 parent a882753 commit 7ffbc53
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions playbooks/roles/xqwatcher/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion playbooks/roles/xqwatcher/tasks/deploy_watcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}

Expand All @@ -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

0 comments on commit 7ffbc53

Please sign in to comment.