Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
feat: Apply DD_TRACE_LOG_STREAM_HANDLER hack to Ansible services (#7155)
Browse files Browse the repository at this point in the history
Backports the trace-debug log fix from edx/helm-charts. Only observed in
ecommerce and analytics-api, but I've added the fix to edxapp as well just
in case it shows up there later (and for general consistency).

See edx/edx-arch-experiments#591
  • Loading branch information
timmc-edx authored Apr 12, 2024
1 parent 17c38f1 commit 2b6662e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions playbooks/roles/edx_django_service/templates/edx/app/app/app.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}"
{% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %}
{% set executable = edx_django_service_venv_bin + '/ddtrace-run ' + executable %}
export DD_TAGS="service:{{ edx_django_service_name }}"
# Workaround for
# https://github.com/edx/edx-arch-experiments/issues/591 (heavy
# streams of trace-debug logs from ddtrace.)
#
# ddtrace is behaving as if DD_TRACE_DEBUG=true, even though that
# should be false by default, and we're not setting it anywhere that
# we can find. Overriding it to false doesn't work, and none of the
# other trace-related configs that are documented seem to help, but
# from testing DD_TRACE_LOG_STREAM_HANDLER=false seems to help.
export DD_TRACE_LOG_STREAM_HANDLER=false
{% endif -%}

export EDX_REST_API_CLIENT_NAME="{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ edx_django_service_name }}"
Expand Down
4 changes: 4 additions & 0 deletions playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}"
{% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %}
{% set executable = edxapp_venv_bin + '/ddtrace-run ' + executable %}
export DD_TAGS="service:edxapp-cms"
# Copied from edx_django_service playbook for consistency; Datadog
# trace debug logging issue doesn't actually affect edxapp for some
# reason.
export DD_TRACE_LOG_STREAM_HANDLER=false
# Datadog's instrumentation breaks pymongo: https://github.com/edx/edx-arch-experiments/issues/580
export DD_TRACE_PYMONGO_ENABLED=false
{% endif -%}
Expand Down
4 changes: 4 additions & 0 deletions playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}"
{% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %}
{% set executable = edxapp_venv_bin + '/ddtrace-run ' + executable %}
export DD_TAGS="service:edxapp-lms"
# Copied from edx_django_service playbook for consistency; Datadog
# trace debug logging issue doesn't actually affect edxapp for some
# reason.
export DD_TRACE_LOG_STREAM_HANDLER=false
# Datadog's instrumentation breaks pymongo: https://github.com/edx/edx-arch-experiments/issues/580
export DD_TRACE_PYMONGO_ENABLED=false
{% endif -%}
Expand Down

0 comments on commit 2b6662e

Please sign in to comment.