From 01d773fbd5efaa0cd4616093794d1b8a25b84e65 Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Wed, 8 May 2024 11:12:34 -0400 Subject: [PATCH] feat: Use common edx- prefix for Datadog service: tag (#4) --- .../ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 | 2 +- playbooks/roles/edx_django_service/defaults/main.yml | 1 + .../roles/edx_django_service/templates/edx/app/app/app.sh.j2 | 2 +- playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2 | 2 +- playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2 | 2 +- playbooks/roles/forum/defaults/main.yml | 2 +- .../roles/insights/templates/edx/app/insights/insights.sh.j2 | 2 +- playbooks/roles/xqueue/defaults/main.yml | 4 ++-- playbooks/roles/xqwatcher/defaults/main.yml | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) 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 82e5bf062f4..2d94a347e16 100644 --- a/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 +++ b/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 @@ -16,7 +16,7 @@ export NEW_RELIC_LICENSE_KEY='{{ NEWRELIC_LICENSE_KEY }}' {% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %} {% set executable = ecommerce_worker_venv_bin + '/ddtrace-run ' + executable %} -export DD_TAGS="service:{{ ecommerce_worker_service_name }}" +export DD_TAGS="service:edx-{{ ecommerce_worker_service_name }}" export DD_DJANGO_USE_LEGACY_RESOURCE_FORMAT=true # Copied from edx_django_service playbook for consistency; Datadog # trace debug logging issue doesn't actually affect edxapp for some diff --git a/playbooks/roles/edx_django_service/defaults/main.yml b/playbooks/roles/edx_django_service/defaults/main.yml index 19eb3a973b5..e0a1da0f162 100644 --- a/playbooks/roles/edx_django_service/defaults/main.yml +++ b/playbooks/roles/edx_django_service/defaults/main.yml @@ -103,6 +103,7 @@ edx_django_service_basic_auth_exempted_paths: '{{ edx_django_service_basic_auth_ edx_django_service_newrelic_appname: '{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ edx_django_service_name }}' edx_django_service_enable_newrelic_distributed_tracing: false +edx_django_datadog_service: 'edx-{{ edx_django_service_name }}' edx_django_service_repos: - PROTOCOL: '{{ edx_django_service_git_protocol }}' diff --git a/playbooks/roles/edx_django_service/templates/edx/app/app/app.sh.j2 b/playbooks/roles/edx_django_service/templates/edx/app/app/app.sh.j2 index 17bac3789ee..a6c9e0a001e 100644 --- a/playbooks/roles/edx_django_service/templates/edx/app/app/app.sh.j2 +++ b/playbooks/roles/edx_django_service/templates/edx/app/app/app.sh.j2 @@ -22,7 +22,7 @@ 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 }}" +export DD_TAGS="service:{{ edx_django_datadog_service }}" export DD_DJANGO_USE_LEGACY_RESOURCE_FORMAT=true # Workaround for # https://github.com/edx/edx-arch-experiments/issues/591 (heavy diff --git a/playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2 b/playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2 index e92a73db9e1..1598a2d8388 100644 --- a/playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2 +++ b/playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2 @@ -22,7 +22,7 @@ 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" +export DD_TAGS="service:edx-edxapp-cms" export DD_DJANGO_USE_LEGACY_RESOURCE_FORMAT=true # Copied from edx_django_service playbook for consistency; Datadog # trace debug logging issue doesn't actually affect edxapp for some diff --git a/playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2 b/playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2 index e514b406148..4ec43ff52ce 100644 --- a/playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2 +++ b/playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2 @@ -22,7 +22,7 @@ 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" +export DD_TAGS="service:edx-edxapp-lms" export DD_DJANGO_USE_LEGACY_RESOURCE_FORMAT=true # Copied from edx_django_service playbook for consistency; Datadog # trace debug logging issue doesn't actually affect edxapp for some diff --git a/playbooks/roles/forum/defaults/main.yml b/playbooks/roles/forum/defaults/main.yml index 93228acc236..9e0c74130ea 100644 --- a/playbooks/roles/forum/defaults/main.yml +++ b/playbooks/roles/forum/defaults/main.yml @@ -50,7 +50,7 @@ FORUM_NEW_RELIC_LICENSE_KEY: '{{ NEWRELIC_LICENSE_KEY | default("") }}' FORUM_NEW_RELIC_APP_NAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-forum" # Datadog CONFIG -FORUM_DD_TAGS: "service:forum" +FORUM_DD_TAGS: "service:edx-forum" FORUM_WORKER_PROCESSES: "4" FORUM_LISTEN_HOST: "0.0.0.0" diff --git a/playbooks/roles/insights/templates/edx/app/insights/insights.sh.j2 b/playbooks/roles/insights/templates/edx/app/insights/insights.sh.j2 index 55a44b59c4e..1bf4cfbda30 100644 --- a/playbooks/roles/insights/templates/edx/app/insights/insights.sh.j2 +++ b/playbooks/roles/insights/templates/edx/app/insights/insights.sh.j2 @@ -16,7 +16,7 @@ export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}" {% if COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP %} {% set executable = insights_venv_bin + '/ddtrace-run ' + executable %} -export DD_TAGS="service:{{ insights_service_name }}" +export DD_TAGS="service:edx-{{ insights_service_name }}" export DD_DJANGO_USE_LEGACY_RESOURCE_FORMAT=true # Copied from edx_django_service playbook for consistency; Datadog # trace debug logging issue doesn't actually affect edxapp for some diff --git a/playbooks/roles/xqueue/defaults/main.yml b/playbooks/roles/xqueue/defaults/main.yml index 2fa2f610398..510d69f28f8 100644 --- a/playbooks/roles/xqueue/defaults/main.yml +++ b/playbooks/roles/xqueue/defaults/main.yml @@ -59,8 +59,8 @@ XQUEUE_MYSQL_CONN_MAX_AGE: 0 # This is Django's default https://docs.djangoproje XQUEUE_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-xqueue" XQUEUE_CONSUMER_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-xqueue_consumer" -XQUEUE_CONSUMER_DATADOG_APPNAME: "xqueue_consumer" -XQUEUE_DATADOG_APPNAME: "{{ xqueue_service_name }}" +XQUEUE_CONSUMER_DATADOG_APPNAME: "edx-xqueue_consumer" +XQUEUE_DATADOG_APPNAME: "edx-{{ xqueue_service_name }}" # Set the number of gunicorn front end workers explicitely for xqueue XQUEUE_WORKERS: !!null diff --git a/playbooks/roles/xqwatcher/defaults/main.yml b/playbooks/roles/xqwatcher/defaults/main.yml index 2bfe8760ee8..9797e0c3989 100644 --- a/playbooks/roles/xqwatcher/defaults/main.yml +++ b/playbooks/roles/xqwatcher/defaults/main.yml @@ -75,7 +75,7 @@ XQWATCHER_REPOS: XQWATCHER_NEWRELIC_APPNAME: "{{ COMMON_DEPLOYMENT }}-{{ COMMON_ENVIRONMENT }}-xqwatcher" XQWATCHER_PIP_EXTRA_ARGS: "-i {{ COMMON_PYPI_MIRROR_URL }}" -XQWATCHER_DATADOG_APPNAME: "{{ xqwatcher_service_name }}" +XQWATCHER_DATADOG_APPNAME: "edx-{{ xqwatcher_service_name }}" # # # vars are namespace with the module name.