From af3124b46a7c0a5355465a19d8f2ca0a055a8fb3 Mon Sep 17 00:00:00 2001 From: Bhavani Gudditi Date: Thu, 25 Sep 2025 19:08:46 +0530 Subject: [PATCH] refactor(configuration): remove the new relic references remove the new relic references remove new relic references from edx services chore(edx-services): remove new relic infrastructure and app references refactor: remove new relic references from edx services refactor: remove new relic references from edx services chore(edx-services): remove new relic infrastructure and app references chore(edx-services): remove new relic infrastructure and app references chore(edx-services): remove new relic infrastructure and app references chore(edx-services): remove new relic infrastructure and app references chore(edx-services): remove new relic infrastructure and app references chore(edx-services): remove new relic infrastructure and app references chore(edx-dx-services): remove new relic infrastructure and app references chore(edx-dx-services): remove new relic infrastructure and app references fix: remove New Relic references from configuration files fix: remove the new relic references chore: remove the new relic references refactor(configuration): remove the new relic references --- playbooks/authn_frontend.yml | 2 - playbooks/blockstore.yml | 4 +- playbooks/commerce_coordinator.yml | 4 +- playbooks/common_edx_base.yml | 2 - playbooks/conductor.yml | 2 +- playbooks/credentials.yml | 4 +- playbooks/designer.yml | 4 +- playbooks/discovery.yml | 2 - playbooks/forum.yml | 2 - playbooks/insights.yml | 2 +- playbooks/jenkins_data_engineering.yml | 5 - playbooks/jenkins_data_engineering_new.yml | 5 - playbooks/jenkins_it.yml | 2 +- playbooks/learner_dashboard.yml | 3 +- playbooks/learner_portal.yml | 3 +- playbooks/library_authoring.yml | 4 +- playbooks/license_manager.yml | 4 +- playbooks/mongo_3_0.yml | 2 - playbooks/mongo_3_2.yml | 2 - playbooks/mongo_3_4.yml | 2 - playbooks/mongo_3_6.yml | 2 - playbooks/mongo_4_0.yml | 2 - playbooks/mongo_4_2.yml | 2 - playbooks/mongo_4_4.yml | 2 - playbooks/mongo_5_0.yml | 2 - playbooks/mongo_6_0.yml | 6 +- playbooks/mongo_7_0.yml | 2 - playbooks/neo4j.yml | 4 +- playbooks/newrelic_mongo_monitor.yml | 12 +- playbooks/notes.yml | 4 +- playbooks/ora_grading.yml | 3 +- playbooks/profile.yml | 2 - playbooks/program_console.yml | 2 - playbooks/rabbitmq.yml | 2 - playbooks/registrar.yml | 4 +- .../roles/analytics_api/defaults/main.yml | 4 - playbooks/roles/analytics_api/meta/main.yml | 4 +- .../templates/defaults/main.yml.j2 | 3 +- .../edx/app/ROLE_NAME/ROLE_NAME.sh.j2 | 17 +- .../app/ROLE_NAME/ROLE_NAME_gunicorn.py.j2 | 2 +- playbooks/roles/common_vars/defaults/main.yml | 3 - playbooks/roles/credentials/meta/main.yml | 2 +- playbooks/roles/designer/meta/main.yml | 2 +- playbooks/roles/ecommerce/defaults/main.yml | 3 +- playbooks/roles/ecommerce/meta/main.yml | 4 +- playbooks/roles/ecomworker/defaults/main.yml | 6 - .../edx/app/ecomworker/ecomworker.sh.j2 | 8 - .../templates/edx/app/app/app-workers.sh.j2 | 47 ++--- .../templates/edx/app/app/app.sh.j2 | 24 +-- .../sites-available/concerns/proxy-to-app.j2 | 3 - .../conf.d.available/app-workers.conf.j2 | 4 +- .../templates/edx/app/app/app.sh.j2 | 15 -- .../roles/edx_notes_api/defaults/main.yml | 2 - .../edx/app/edx_notes_api/edx_notes_api.sh.j2 | 10 -- .../roles/enterprise_catalog/meta/main.yml | 1 - playbooks/roles/forum/defaults/main.yml | 8 - playbooks/roles/hermes/defaults/main.yml | 2 +- playbooks/roles/hermes/templates/hermes.sh.j2 | 15 +- .../templates/edx/app/hotg/Config.groovy.j2 | 6 - .../templates/edx/app/insights/insights.sh.j2 | 8 - playbooks/roles/license_manager/meta/main.yml | 1 - .../mongo_newrelic_monitor/defaults/main.yml | 10 +- .../mongo_newrelic_monitor/meta/main.yml | 3 +- .../mongo_newrelic_monitor/tasks/main.yml | 41 ----- .../templates/mongodb-config.yml.j2 | 72 ++++---- .../newrelic_infrastructure/defaults/main.yml | 13 +- .../edx/bin/write_nr_display_name_config.sh | 30 ++-- .../newrelic_infrastructure/tasks/main.yml | 162 +----------------- .../templates/etc/newrelic-infra.j2 | 2 - .../etc/newrelic-infra/logging.d/logs.yml.j2 | 3 +- .../nginx/sites-available/analytics_api.j2 | 3 - .../app/nginx/sites-available/cms_proxy.j2 | 3 - .../nginx/sites-available/edx_notes_api.j2 | 3 - .../edx/app/nginx/sites-available/forum.j2 | 3 - .../edx/app/nginx/sites-available/grafana.j2 | 3 - .../edx/app/nginx/sites-available/graphite.j2 | 3 - .../edx/app/nginx/sites-available/insights.j2 | 3 - .../app/nginx/sites-available/lms_proxy.j2 | 3 - .../edx/app/nginx/sites-available/xqueue.j2 | 3 - playbooks/roles/prospectus/defaults/main.yml | 3 - .../prospectus/templates/.env.environment.j2 | 3 - playbooks/roles/registrar/meta/main.yml | 2 +- .../roles/xqueue/templates/xqueue.conf.j2 | 8 +- .../xqueue/templates/xqueue_consumer.conf.j2 | 12 +- playbooks/roles/xqwatcher/defaults/main.yml | 2 +- playbooks/roles/xqwatcher/tasks/main.yml | 1 - .../app/supervisor/conf.d/xqwatcher.conf.j2 | 6 +- playbooks/sample_vars/server_vars.yml | 1 + playbooks/tools_jenkins.yml | 2 - 89 files changed, 126 insertions(+), 592 deletions(-) diff --git a/playbooks/authn_frontend.yml b/playbooks/authn_frontend.yml index 9d80a8e95..d7d7c719b 100644 --- a/playbooks/authn_frontend.yml +++ b/playbooks/authn_frontend.yml @@ -11,5 +11,3 @@ - role: authn - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE diff --git a/playbooks/blockstore.yml b/playbooks/blockstore.yml index eb33aab34..95ea665f3 100644 --- a/playbooks/blockstore.yml +++ b/playbooks/blockstore.yml @@ -3,7 +3,7 @@ become: True gather_facts: True vars: - ENABLE_NEWRELIC: True + ENABLE_NEWRELIC: False CLUSTER_NAME: 'blockstore' roles: - role: aws @@ -14,8 +14,6 @@ - blockstore - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: hermes HERMES_TARGET_SERVICE: 'blockstore' when: BLOCKSTORE_HERMES_ENABLED diff --git a/playbooks/commerce_coordinator.yml b/playbooks/commerce_coordinator.yml index 5968f528f..1855b1a0d 100644 --- a/playbooks/commerce_coordinator.yml +++ b/playbooks/commerce_coordinator.yml @@ -3,7 +3,7 @@ become: True gather_facts: True vars: - ENABLE_NEWRELIC: True + ENABLE_NEWRELIC: False CLUSTER_NAME: 'commerce_coordinator' REGISTRAR_ENABLED: True roles: @@ -15,8 +15,6 @@ - commerce_coordinator - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: hermes HERMES_TARGET_SERVICE: 'commerce_coordinator' when: COMMERCE_COORDINATOR__HERMES_ENABLED diff --git a/playbooks/common_edx_base.yml b/playbooks/common_edx_base.yml index 7ffeb4ef5..a968cdcba 100644 --- a/playbooks/common_edx_base.yml +++ b/playbooks/common_edx_base.yml @@ -15,8 +15,6 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/conductor.yml b/playbooks/conductor.yml index c5e987bcf..8cca07b72 100644 --- a/playbooks/conductor.yml +++ b/playbooks/conductor.yml @@ -3,7 +3,7 @@ become: True gather_facts: True vars: - ENABLE_NEWRELIC: False + ENABLE_NEWRELIC: False # Already disabled CLUSTER_NAME: 'conductor' NGINX_OVERRIDE_DEFAULT_MAP_HASH_SIZE: True NGINX_MAP_HASH_MAX_SIZE: 4096 diff --git a/playbooks/credentials.yml b/playbooks/credentials.yml index 625d6ea83..698ff7117 100644 --- a/playbooks/credentials.yml +++ b/playbooks/credentials.yml @@ -16,9 +16,7 @@ - role: datadog when: COMMON_ENABLE_DATADOG - role: splunkforwarder - when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE + when: COMMON_ENABLE_SPLUNKFORWARDE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG - role: hermes diff --git a/playbooks/designer.yml b/playbooks/designer.yml index ada06ab1e..e4a282e28 100644 --- a/playbooks/designer.yml +++ b/playbooks/designer.yml @@ -3,7 +3,7 @@ become: True gather_facts: True vars: - ENABLE_NEWRELIC: True + ENABLE_NEWRELIC: False CLUSTER_NAME: 'designer' roles: - role: aws @@ -14,8 +14,6 @@ - designer - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: hermes HERMES_TARGET_SERVICE: 'designer' when: DESIGNER_HERMES_ENABLED diff --git a/playbooks/discovery.yml b/playbooks/discovery.yml index eb0717c08..f01150631 100644 --- a/playbooks/discovery.yml +++ b/playbooks/discovery.yml @@ -17,8 +17,6 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG - role: hermes diff --git a/playbooks/forum.yml b/playbooks/forum.yml index b3ee89ab9..b8c84680e 100644 --- a/playbooks/forum.yml +++ b/playbooks/forum.yml @@ -17,7 +17,5 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/insights.yml b/playbooks/insights.yml index 7e8c97ab8..935d72bcb 100644 --- a/playbooks/insights.yml +++ b/playbooks/insights.yml @@ -4,7 +4,7 @@ gather_facts: True vars: ENABLE_DATADOG: False - ENABLE_NEWRELIC: True + ENABLE_NEWRELIC: False CLUSTER_NAME: 'insights' roles: - role: aws diff --git a/playbooks/jenkins_data_engineering.yml b/playbooks/jenkins_data_engineering.yml index f78e1f1ee..2c0536b8b 100644 --- a/playbooks/jenkins_data_engineering.yml +++ b/playbooks/jenkins_data_engineering.yml @@ -20,7 +20,6 @@ gather_facts: True vars: COMMON_ENABLE_SPLUNKFORWARDER: False - COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE: True COMMON_SECURITY_UPDATES: yes SECURITY_UPGRADE_ON_ANSIBLE: true @@ -28,10 +27,6 @@ - role: aws when: COMMON_ENABLE_AWS_ROLE - jenkins_data_engineering - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - tags: - - newreliconly - role: aws_cloudwatch_agent tags: - cloudwatch diff --git a/playbooks/jenkins_data_engineering_new.yml b/playbooks/jenkins_data_engineering_new.yml index 08e2fd3a2..d8d9d1a11 100644 --- a/playbooks/jenkins_data_engineering_new.yml +++ b/playbooks/jenkins_data_engineering_new.yml @@ -20,7 +20,6 @@ gather_facts: True vars: COMMON_ENABLE_SPLUNKFORWARDER: False - COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE: True COMMON_SECURITY_UPDATES: yes SECURITY_UPGRADE_ON_ANSIBLE: true ansible_distribution_release: focal @@ -30,10 +29,6 @@ when: COMMON_ENABLE_AWS_ROLE - docker-tools - jenkins_data_engineering_new - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - tags: - - newreliconly - role: aws_cloudwatch_agent tags: - cloudwatch diff --git a/playbooks/jenkins_it.yml b/playbooks/jenkins_it.yml index 3a34b4a36..4aad4d905 100644 --- a/playbooks/jenkins_it.yml +++ b/playbooks/jenkins_it.yml @@ -11,7 +11,7 @@ become: True gather_facts: True vars: - COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE: True + COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE: False COMMON_SECURITY_UPDATES: yes SECURITY_UPGRADE_ON_ANSIBLE: true diff --git a/playbooks/learner_dashboard.yml b/playbooks/learner_dashboard.yml index e4d47f9d1..e510d952b 100644 --- a/playbooks/learner_dashboard.yml +++ b/playbooks/learner_dashboard.yml @@ -13,5 +13,4 @@ MFE_VERSION: '{{ LEARNER_DASHBOARD_MFE_VERSION }}' - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE + diff --git a/playbooks/learner_portal.yml b/playbooks/learner_portal.yml index cab41f71b..cf58ffe0e 100644 --- a/playbooks/learner_portal.yml +++ b/playbooks/learner_portal.yml @@ -17,5 +17,4 @@ - learner_portal - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE + diff --git a/playbooks/library_authoring.yml b/playbooks/library_authoring.yml index b5881bb25..377e78b2f 100644 --- a/playbooks/library_authoring.yml +++ b/playbooks/library_authoring.yml @@ -11,6 +11,4 @@ - role: library_authoring MFE_NAME: library-authoring - role: splunkforwarder - when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELICE_INFRASTRUCTURE \ No newline at end of file + when: COMMON_ENABLE_SPLUNKFORWARDER \ No newline at end of file diff --git a/playbooks/license_manager.yml b/playbooks/license_manager.yml index 691ef7ccb..e29666203 100644 --- a/playbooks/license_manager.yml +++ b/playbooks/license_manager.yml @@ -3,7 +3,7 @@ become: True gather_facts: True vars: - ENABLE_NEWRELIC: True + ENABLE_NEWRELIC: False CLUSTER_NAME: 'license_manager' REGISTRAR_ENABLED: True roles: @@ -15,8 +15,6 @@ - license_manager - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: hermes HERMES_TARGET_SERVICE: 'license_manager' when: REGISTRAR_HERMES_ENABLED diff --git a/playbooks/mongo_3_0.yml b/playbooks/mongo_3_0.yml index dca352b65..30136ab0d 100644 --- a/playbooks/mongo_3_0.yml +++ b/playbooks/mongo_3_0.yml @@ -24,8 +24,6 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/mongo_3_2.yml b/playbooks/mongo_3_2.yml index c22c43eba..c2c1318c4 100644 --- a/playbooks/mongo_3_2.yml +++ b/playbooks/mongo_3_2.yml @@ -29,8 +29,6 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/mongo_3_4.yml b/playbooks/mongo_3_4.yml index 139f46931..ffa6580af 100644 --- a/playbooks/mongo_3_4.yml +++ b/playbooks/mongo_3_4.yml @@ -29,7 +29,5 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/mongo_3_6.yml b/playbooks/mongo_3_6.yml index 5056d2789..bc59ac466 100644 --- a/playbooks/mongo_3_6.yml +++ b/playbooks/mongo_3_6.yml @@ -29,7 +29,5 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/mongo_4_0.yml b/playbooks/mongo_4_0.yml index 42f7e6ac9..8dd8a6831 100644 --- a/playbooks/mongo_4_0.yml +++ b/playbooks/mongo_4_0.yml @@ -29,7 +29,5 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/mongo_4_2.yml b/playbooks/mongo_4_2.yml index 50e75177f..ae80fd0ba 100644 --- a/playbooks/mongo_4_2.yml +++ b/playbooks/mongo_4_2.yml @@ -23,7 +23,5 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/mongo_4_4.yml b/playbooks/mongo_4_4.yml index b11f769fc..c7e5e48c3 100644 --- a/playbooks/mongo_4_4.yml +++ b/playbooks/mongo_4_4.yml @@ -23,7 +23,5 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/mongo_5_0.yml b/playbooks/mongo_5_0.yml index 24a7a20b0..56f05b537 100644 --- a/playbooks/mongo_5_0.yml +++ b/playbooks/mongo_5_0.yml @@ -23,7 +23,5 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/mongo_6_0.yml b/playbooks/mongo_6_0.yml index 6799b7ec7..1d27064a7 100644 --- a/playbooks/mongo_6_0.yml +++ b/playbooks/mongo_6_0.yml @@ -23,7 +23,7 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall - when: not COMMON_ENABLE_DATADOG + when: not + + \ No newline at end of file diff --git a/playbooks/mongo_7_0.yml b/playbooks/mongo_7_0.yml index 1fd4c6aa8..db561cffe 100644 --- a/playbooks/mongo_7_0.yml +++ b/playbooks/mongo_7_0.yml @@ -23,7 +23,5 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG diff --git a/playbooks/neo4j.yml b/playbooks/neo4j.yml index d96a3182a..fb9df0eed 100644 --- a/playbooks/neo4j.yml +++ b/playbooks/neo4j.yml @@ -14,6 +14,4 @@ # - aws - neo4j - role: splunkforwarder - when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE \ No newline at end of file + when: COMMON_ENABLE_SPLUNKFORWARDER \ No newline at end of file diff --git a/playbooks/newrelic_mongo_monitor.yml b/playbooks/newrelic_mongo_monitor.yml index 284852885..164884e73 100644 --- a/playbooks/newrelic_mongo_monitor.yml +++ b/playbooks/newrelic_mongo_monitor.yml @@ -1,7 +1,7 @@ -- name: Configure newrelic mongo monitoring - hosts: all - become: True - gather_facts: True - roles: - - mongo_newrelic_monitor +# - name: Configure newrelic mongo monitoring +# hosts: all +# become: True +# gather_facts: True +# roles: +# - mongo_newrelic_monitor diff --git a/playbooks/notes.yml b/playbooks/notes.yml index 0f0d0149c..d1c79a7fd 100644 --- a/playbooks/notes.yml +++ b/playbooks/notes.yml @@ -4,7 +4,7 @@ gather_facts: True vars: ENABLE_DATADOG: False - ENABLE_NEWRELIC: True + ENABLE_NEWRELIC: False roles: - role: aws when: COMMON_ENABLE_AWS_ROLE @@ -16,8 +16,6 @@ when: COMMON_ENABLE_DATADOG - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: datadog-uninstall when: not COMMON_ENABLE_DATADOG - role: hermes diff --git a/playbooks/ora_grading.yml b/playbooks/ora_grading.yml index 8d63e0c6e..f597f042a 100644 --- a/playbooks/ora_grading.yml +++ b/playbooks/ora_grading.yml @@ -12,6 +12,5 @@ MFE_NAME: ora-grading - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELICE_INFRASTRUCTURE + diff --git a/playbooks/profile.yml b/playbooks/profile.yml index 2698d9820..18c6e1944 100644 --- a/playbooks/profile.yml +++ b/playbooks/profile.yml @@ -13,5 +13,3 @@ MFE_VERSION: '{{ PROFILE_MFE_VERSION }}' - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE diff --git a/playbooks/program_console.yml b/playbooks/program_console.yml index 1c4f2ab4c..272adcade 100644 --- a/playbooks/program_console.yml +++ b/playbooks/program_console.yml @@ -17,5 +17,3 @@ - program_console - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE diff --git a/playbooks/rabbitmq.yml b/playbooks/rabbitmq.yml index 0e166a9bf..26f435b49 100644 --- a/playbooks/rabbitmq.yml +++ b/playbooks/rabbitmq.yml @@ -39,8 +39,6 @@ - rabbitmq - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE post_tasks: - debug: var: ansible_ec2_instance_id diff --git a/playbooks/registrar.yml b/playbooks/registrar.yml index 018baceae..7064c1d4c 100644 --- a/playbooks/registrar.yml +++ b/playbooks/registrar.yml @@ -3,7 +3,7 @@ become: True gather_facts: True vars: - ENABLE_NEWRELIC: True + ENABLE_NEWRELIC: False CLUSTER_NAME: 'registrar' REGISTRAR_ENABLED: True roles: @@ -15,8 +15,6 @@ - registrar - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE - role: hermes HERMES_TARGET_SERVICE: 'registrar' when: REGISTRAR_HERMES_ENABLED diff --git a/playbooks/roles/analytics_api/defaults/main.yml b/playbooks/roles/analytics_api/defaults/main.yml index 880f91c0c..75b799399 100644 --- a/playbooks/roles/analytics_api/defaults/main.yml +++ b/playbooks/roles/analytics_api/defaults/main.yml @@ -34,8 +34,6 @@ analytics_api_code_dir: "{{ analytics_api_home }}/{{ analytics_api_service_name analytics_api_wsgi_name: "analyticsdataserver" analytics_api_hostname: "analytics-api" -analytics_api_newrelic_appname: 'analytics-api' - # # OS packages # @@ -182,8 +180,6 @@ analytics_api_service_config_overrides: ANALYTICS_API_USERS: "dummy-api-user": "changeme" -ANALYTICS_API_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false - # Remote config ANALYTICS_API_HERMES_ENABLED: "{{ COMMON_HERMES_ENABLED }}" diff --git a/playbooks/roles/analytics_api/meta/main.yml b/playbooks/roles/analytics_api/meta/main.yml index 9133a0824..03e89cea9 100644 --- a/playbooks/roles/analytics_api/meta/main.yml +++ b/playbooks/roles/analytics_api/meta/main.yml @@ -42,13 +42,13 @@ dependencies: edx_django_service_secret_key: '{{ ANALYTICS_API_SECRET_KEY }}' edx_django_service_wsgi_name: '{{ analytics_api_wsgi_name }}' edx_django_service_hostname: '~^((stage|prod)-)?{{ analytics_api_hostname }}.*' - edx_django_service_newrelic_appname: '{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ analytics_api_newrelic_appname }}' + #edx_django_service_newrelic_appname: '{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ analytics_api_newrelic_appname }}' edx_django_service_automated_users: '{{ ANALYTICS_API_AUTOMATED_USERS }}' edx_django_service_cors_whitelist: '{{ ANALYTICS_API_CORS_ORIGIN_WHITELIST }}' edx_django_service_allow_cors_headers: '{{ ANALYTICS_API_ALLOW_CORS_HEADERS }}' edx_django_service_allow_cors_credentials: '{{ ANALYTICS_API_ALLOW_CORS_CREDENTIALS }}' edx_django_service_basic_auth_exempted_paths_extra: '{{ ANALYTICS_API_BASIC_AUTH_EXEMPTED_PATHS }}' - edx_django_service_enable_newrelic_distributed_tracing: '{{ ANALYTICS_API_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' + #edx_django_service_enable_newrelic_distributed_tracing: '{{ ANALYTICS_API_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' edx_django_service_decrypt_config_enabled: '{{ ANALYTICS_API_DECRYPT_CONFIG_ENABLED }}' edx_django_service_copy_config_enabled: '{{ ANALYTICS_API_COPY_CONFIG_ENABLED }}' edx_django_datadog_service: '{{ analytics_api_datadog_service_name }}' diff --git a/playbooks/roles/ansible-role-django-ida/templates/defaults/main.yml.j2 b/playbooks/roles/ansible-role-django-ida/templates/defaults/main.yml.j2 index 5acc8e57c..e7413252f 100644 --- a/playbooks/roles/ansible-role-django-ida/templates/defaults/main.yml.j2 +++ b/playbooks/roles/ansible-role-django-ida/templates/defaults/main.yml.j2 @@ -7,8 +7,7 @@ # depends upon Newrelic being enabled via COMMON_ENABLE_NEWRELIC # and a key being provided via NEWRELIC_LICENSE_KEY -{{ role_name|upper }}_NEWRELIC_APPNAME: "{{ '{{ COMMON_ENVIRONMENT }}' }}-{{ '{{ COMMON_DEPLOYMENT }}' }}-{{ '{{' }} {{ role_name }}_service_name }}" -{{ role_name|upper }}_PIP_EXTRA_ARGS: "-i {{ '{{ COMMON_PYPI_MIRROR_URL }}' }}" +# {{ role_name|upper }}_PIP_EXTRA_ARGS: "-i {{ '{{ COMMON_PYPI_MIRROR_URL }}' }}" {{ role_name|upper }}_NGINX_PORT: 18{{ port_suffix }} {{ role_name|upper }}_SSL_NGINX_PORT: 48{{ port_suffix }} diff --git a/playbooks/roles/ansible-role-django-ida/templates/templates/edx/app/ROLE_NAME/ROLE_NAME.sh.j2 b/playbooks/roles/ansible-role-django-ida/templates/templates/edx/app/ROLE_NAME/ROLE_NAME.sh.j2 index 0bcbab513..44d8184ad 100644 --- a/playbooks/roles/ansible-role-django-ida/templates/templates/edx/app/ROLE_NAME/ROLE_NAME.sh.j2 +++ b/playbooks/roles/ansible-role-django-ida/templates/templates/edx/app/ROLE_NAME/ROLE_NAME.sh.j2 @@ -2,18 +2,11 @@ # {{ '{{' }} ansible_managed }} -{{ '{%' }} set {{ role_name }}_venv_bin = {{ role_name }}_home + "/venvs/" + {{ role_name }}_service_name + "/bin" %} -{{ '{%' }} if COMMON_ENABLE_NEWRELIC_APP %} -{{ '{%' }} set executable = {{ role_name }}_venv_bin + '/newrelic-admin run-program ' + {{ role_name }}_venv_bin + '/gunicorn' %} -{{ '{%' }} else %} -{{ '{%' }} set executable = {{ role_name }}_venv_bin + '/gunicorn' %} -{{ '{%' }} endif %} +{% set role_venv_bin = role_home + "/venvs/" + role_service_name + "/bin" %} -{{ '{%' }} if COMMON_ENABLE_NEWRELIC_APP %} -export NEW_RELIC_APP_NAME="{{ '{{' }} {{ role_name|upper }}_NEWRELIC_APPNAME }}" -export NEW_RELIC_LICENSE_KEY="{{ '{{' }} NEWRELIC_LICENSE_KEY }}" -{{ '{%' }} endif -%} +{% set executable = role_venv_bin + '/gunicorn' %} + +source {{ role_home }}/{{ role_name }}_env -source {{ '{{' }} {{ role_name }}_home }}/{{ role_name }}_env # We exec so that gunicorn is the child of supervisor and can be managed properly -exec {{ '{{' }} executable }} -c {{ '{{' }} {{ role_name }}_home }}/{{ role_name }}_gunicorn.py {{ '{{' }} {{ role_name|upper }}_GUNICORN_EXTRA }} {{ role_name }}.wsgi:application +exec {{ executable }} -c {{ role_home }}/{{ role_name }}_gunicorn.py {{ (role_name|upper ~ '_GUNICORN_EXTRA') }} {{ role_name }}.wsgi:application diff --git a/playbooks/roles/ansible-role-django-ida/templates/templates/edx/app/ROLE_NAME/ROLE_NAME_gunicorn.py.j2 b/playbooks/roles/ansible-role-django-ida/templates/templates/edx/app/ROLE_NAME/ROLE_NAME_gunicorn.py.j2 index fb1ac4ee7..9e3803699 100644 --- a/playbooks/roles/ansible-role-django-ida/templates/templates/edx/app/ROLE_NAME/ROLE_NAME_gunicorn.py.j2 +++ b/playbooks/roles/ansible-role-django-ida/templates/templates/edx/app/ROLE_NAME/ROLE_NAME_gunicorn.py.j2 @@ -13,4 +13,4 @@ worker_class = "{{ '{{' }} {{ role_name|upper }}_GUNICORN_WORKER_CLASS }}" max_requests = {{ '{{' }} {{ role_name|upper }}_GUNICORN_MAX_REQUESTS }} {{ '{%' }} endif {{ '%}' }} -{{ '{{' }} {{ role_name|upper }}_GUNICORN_EXTRA_CONF }} +{{ '{{' }} {{ role_name|upper }}_GUNICORN_EXTRA_CONF }} \ No newline at end of file diff --git a/playbooks/roles/common_vars/defaults/main.yml b/playbooks/roles/common_vars/defaults/main.yml index e461607cd..3f4bbe129 100644 --- a/playbooks/roles/common_vars/defaults/main.yml +++ b/playbooks/roles/common_vars/defaults/main.yml @@ -106,11 +106,8 @@ COMMON_ENABLE_DATADOG_APP_SERVICES: [] COMMON_ENABLE_DATADOG_PROFILING: False COMMON_ENABLE_NGINXTRA: False COMMON_ENABLE_SPLUNKFORWARDER: False -COMMON_ENABLE_NEWRELIC: False -COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE: False # enables app reporting, you must enable newrelic # as well -COMMON_ENABLE_NEWRELIC_APP: False COMMON_ENABLE_MINOS: False COMMON_ENABLE_INSIGHTVM_AGENT: False COMMON_TAG_EC2_INSTANCE: False diff --git a/playbooks/roles/credentials/meta/main.yml b/playbooks/roles/credentials/meta/main.yml index 46d2c432a..96808fdfb 100644 --- a/playbooks/roles/credentials/meta/main.yml +++ b/playbooks/roles/credentials/meta/main.yml @@ -47,7 +47,7 @@ dependencies: edx_django_service_automated_users: '{{ CREDENTIALS_AUTOMATED_USERS }}' edx_django_service_cors_whitelist: '{{ CREDENTIALS_CORS_ORIGIN_WHITELIST }}' edx_django_service_post_migrate_commands: '{{ credentials_post_migrate_commands }}' - edx_django_service_enable_newrelic_distributed_tracing: '{{ CREDENTIALS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' + # edx_django_service_enable_newrelic_distributed_tracing: '{{ CREDENTIALS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' edx_django_service_decrypt_config_enabled: '{{ CREDENTIALS_DECRYPT_CONFIG_ENABLED }}' edx_django_service_copy_config_enabled: '{{ CREDENTIALS_COPY_CONFIG_ENABLED }}' EDX_DJANGO_SERVICE_ENABLE_ADMIN_URLS_RESTRICTION: '{{ CREDENTIALS_ENABLE_ADMIN_URLS_RESTRICTION }}' diff --git a/playbooks/roles/designer/meta/main.yml b/playbooks/roles/designer/meta/main.yml index 12551fd4b..6432147a9 100644 --- a/playbooks/roles/designer/meta/main.yml +++ b/playbooks/roles/designer/meta/main.yml @@ -44,6 +44,6 @@ dependencies: edx_django_service_automated_users: '{{ DESIGNER_AUTOMATED_USERS }}' edx_django_service_cors_whitelist: '{{ DESIGNER_CORS_ORIGIN_WHITELIST }}' edx_django_service_post_migrate_commands: '{{ designer_post_migrate_commands }}' - edx_django_service_enable_newrelic_distributed_tracing: '{{ DESIGNER_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' + # edx_django_service_enable_newrelic_distributed_tracing: '{{ DESIGNER_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' edx_django_service_decrypt_config_enabled: '{{ DESIGNER_DECRYPT_CONFIG_ENABLED }}' edx_django_service_copy_config_enabled: '{{ DESIGNER_COPY_CONFIG_ENABLED }}' diff --git a/playbooks/roles/ecommerce/defaults/main.yml b/playbooks/roles/ecommerce/defaults/main.yml index 293bfecd0..16c96e336 100644 --- a/playbooks/roles/ecommerce/defaults/main.yml +++ b/playbooks/roles/ecommerce/defaults/main.yml @@ -37,7 +37,6 @@ ECOMMERCE_ADD_EXTRA_REQUIREMENTS_TO_REQUIREMENTS_FILE: false # depends upon Newrelic being enabled via COMMON_ENABLE_NEWRELIC # and a key being provided via NEWRELIC_LICENSE_KEY -ECOMMERCE_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ ecommerce_service_name }}" ECOMMERCE_PIP_EXTRA_ARGS: "-i {{ COMMON_PYPI_MIRROR_URL }}" ECOMMERCE_NGINX_PORT: 18130 ECOMMERCE_SSL_NGINX_PORT: 48130 @@ -311,7 +310,7 @@ ECOMMERCE_ENABLE_ADMIN_URLS_RESTRICTION: false ECOMMERCE_ADMIN_URLS: - admin -ECOMMERCE_ENABLE_NEWRELIC_APP: true +ECOMMERCE_ENABLE_NEWRELIC_APP: false ECOMMERCE_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false # Python 3 conversion diff --git a/playbooks/roles/ecommerce/meta/main.yml b/playbooks/roles/ecommerce/meta/main.yml index 705cf91b1..b3f544b03 100644 --- a/playbooks/roles/ecommerce/meta/main.yml +++ b/playbooks/roles/ecommerce/meta/main.yml @@ -63,8 +63,8 @@ dependencies: - payment - \.well-known/apple-developer-merchantid-domain-association edx_django_service_automated_users: '{{ ECOMMERCE_AUTOMATED_USERS }}' - edx_django_service_enable_newrelic_app: '{{ ECOMMERCE_ENABLE_NEWRELIC_APP }}' - edx_django_service_enable_newrelic_distributed_tracing: '{{ ECOMMERCE_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' + # edx_django_service_enable_newrelic_app: '{{ ECOMMERCE_ENABLE_NEWRELIC_APP }}' + # edx_django_service_enable_newrelic_distributed_tracing: '{{ ECOMMERCE_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' edx_django_service_decrypt_config_enabled: '{{ ECOMMERCE_DECRYPT_CONFIG_ENABLED }}' edx_django_service_copy_config_enabled: '{{ ECOMMERCE_COPY_CONFIG_ENABLED }}' EDX_DJANGO_SERVICE_ENABLE_ADMIN_URLS_RESTRICTION: '{{ ECOMMERCE_ENABLE_ADMIN_URLS_RESTRICTION }}' diff --git a/playbooks/roles/ecomworker/defaults/main.yml b/playbooks/roles/ecomworker/defaults/main.yml index 1e2a9ff1f..86f59bc1b 100644 --- a/playbooks/roles/ecomworker/defaults/main.yml +++ b/playbooks/roles/ecomworker/defaults/main.yml @@ -24,12 +24,6 @@ ECOMMERCE_WORKER_REPOS: DESTINATION: '{{ ecommerce_worker_code_dir }}' SSH_KEY: '{{ ECOMMERCE_WORKER_GIT_IDENTITY }}' -# Requires that New Relic be enabled via COMMON_ENABLE_NEWRELIC, and that -# a key be provided via NEWRELIC_LICENSE_KEY. -ECOMMERCE_WORKER_NEWRELIC_APPNAME: '{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ ecommerce_worker_service_name }}' -ECOMMERCE_WORKER_ENABLE_NEWRELIC_APP: '{{ COMMON_ENABLE_NEWRELIC_APP }}' -ECOMMERCE_WORKER_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false - # Datadog ECOMMERCE_WORKER_DATADOG_ENABLE: "{{COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP}}" 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 769acd59a..e49539be0 100644 --- a/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 +++ b/playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 @@ -6,14 +6,6 @@ {% set executable = ecommerce_worker_venv_bin + '/celery' %} -{% if ECOMMERCE_WORKER_ENABLE_NEWRELIC_APP %} -{% set executable = ecommerce_worker_venv_bin + '/newrelic-admin run-program ' + ecommerce_worker_venv_bin + '/celery' %} - -export NEW_RELIC_DISTRIBUTED_TRACING_ENABLED='{{ ECOMMERCE_WORKER_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' -export NEW_RELIC_APP_NAME='{{ ECOMMERCE_WORKER_NEWRELIC_APPNAME }}' -export NEW_RELIC_LICENSE_KEY='{{ NEWRELIC_LICENSE_KEY }}' -{% endif -%} - {% 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 }}" diff --git a/playbooks/roles/edx_django_service/templates/edx/app/app/app-workers.sh.j2 b/playbooks/roles/edx_django_service/templates/edx/app/app/app-workers.sh.j2 index f1dd4d1b3..4513fb54e 100644 --- a/playbooks/roles/edx_django_service/templates/edx/app/app/app-workers.sh.j2 +++ b/playbooks/roles/edx_django_service/templates/edx/app/app/app-workers.sh.j2 @@ -2,58 +2,37 @@ # {{ ansible_managed }} +# Set path to virtual environment bin directory {% set edx_django_service_venv_bin = edx_django_service_venv_dir + "/bin" %} -{% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = edx_django_service_venv_bin + '/newrelic-admin run-program ' + edx_django_service_venv_bin + '/celery' %} -{% else %} +# Set the default executable to Celery {% set executable = edx_django_service_venv_bin + '/celery' %} -{% endif %} - -{% if COMMON_ENABLE_NEWRELIC_APP %} -HOSTNAME=$(hostname) -export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="$HOSTNAME" -if command -v ec2metadata >/dev/null 2>&1; then - INSTANCEID=$(ec2metadata --instance-id); - export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="$HOSTNAME-$INSTANCEID" -fi -{% endif %} +# Load the service environment source {{ edx_django_service_home }}/{{ edx_django_service_name }}_env {% if edx_django_service_enable_experimental_docker_shim %} +# Find old containers and remove them to reuse the container name OLD_CONTAINERS=$(docker ps -aq --filter name="^{{ edx_django_service_name }}-worker-${DOCKER_WORKER_QUEUE}-${DOCKER_WORKER_NUM}\$") - -# Delete old container so we can reuse the contianer name if [[ -n "${OLD_CONTAINERS}" ]]; then docker rm ${OLD_CONTAINERS} > /dev/null 2>&1 fi -# We exec so that celery is the child of supervisor and can be managed properly +# Run Celery inside Docker exec docker run \ --name {{ edx_django_service_name }}-worker-${DOCKER_WORKER_QUEUE}-${DOCKER_WORKER_NUM} \ --mount type=bind,src={{ edx_django_service_app_config_file }},dst={{ edx_django_service_app_config_file }} \ -{% if COMMON_ENABLE_NEWRELIC_APP %} - --env NEW_RELIC_DISTRIBUTED_TRACING_ENABLED \ - --env NEW_RELIC_APP_NAME \ - --env NEW_RELIC_PROCESS_HOST_DISPLAY_NAME \ - --env NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}" \ -{% endif -%} -{% for name,value in edx_django_service_environment.items() -%} -{%- if value %} +{% for name, value in edx_django_service_environment.items() %} +{% if value %} --env {{ name }} \ {% endif %} -{%- endfor %} -{% if COMMON_ENABLE_NEWRELIC_APP %} - {{ edx_django_service_docker_image_name }}:latest-newrelic \ - newrelic-admin run-program \ -{% else %} - {{ edx_django_service_docker_image_name }}:latest \ -{% endif %} - celery \ - $@ +{% endfor %} + {{ edx_django_service_docker_image_name }}:latest celery $@ + {% else %} -# We exec so that celery is the child of supervisor and can be managed properly + +# Run Celery directly from virtual environment exec {{ executable }} $@ + {% endif %} 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 f57ebe9ac..36ccaed17 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 @@ -6,19 +6,6 @@ {% set executable = edx_django_service_venv_bin + '/gunicorn' %} -{% if edx_django_service_enable_newrelic_app %} -{% set executable = edx_django_service_venv_bin + '/newrelic-admin run-program ' + executable %} - -export NEW_RELIC_DISTRIBUTED_TRACING_ENABLED="{{ edx_django_service_enable_newrelic_distributed_tracing }}" -export NEW_RELIC_APP_NAME="{{ edx_django_service_newrelic_appname }}" -HOSTNAME=$(hostname) -export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="$HOSTNAME" -if command -v ec2metadata >/dev/null 2>&1; then - INSTANCEID=$(ec2metadata --instance-id); - export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="$HOSTNAME-$INSTANCEID" -fi -export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}" -{% endif -%} {% if edx_django_service_datadog_enable %} {% set executable = edx_django_service_venv_bin + '/ddtrace-run ' + executable %} @@ -57,22 +44,13 @@ exec docker run \ --name {{ edx_django_service_name }} \ --mount type=bind,src={{ edx_django_service_app_config_file }},dst={{ edx_django_service_app_config_file }} \ --publish 127.0.0.1:{{ edx_django_service_gunicorn_port }}:{{ edx_django_service_gunicorn_port }}/tcp \ -{% if edx_django_service_enable_newrelic_app %} - --env NEW_RELIC_DISTRIBUTED_TRACING_ENABLED \ - --env NEW_RELIC_APP_NAME \ - --env NEW_RELIC_PROCESS_HOST_DISPLAY_NAME \ - --env NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}" \ -{% endif -%} {% for name,value in edx_django_service_environment.items() -%} {%- if value %} --env {{ name }} \ {% endif %} {%- endfor %} -{% if COMMON_ENABLE_NEWRELIC_APP %} - {{ edx_django_service_docker_image_name }}:latest-newrelic -{% else %} {{ edx_django_service_docker_image_name }}:latest -{% endif %} + {% else %} exec {{ executable }} -c {{ edx_django_service_home }}/{{ edx_django_service_name }}_gunicorn.py {{ edx_django_service_gunicorn_extra }} {{ edx_django_service_wsgi_name }}.wsgi:application {% endif %} diff --git a/playbooks/roles/edx_django_service/templates/edx/app/nginx/sites-available/concerns/proxy-to-app.j2 b/playbooks/roles/edx_django_service/templates/edx/app/nginx/sites-available/concerns/proxy-to-app.j2 index 73b38a596..01fb5e273 100644 --- a/playbooks/roles/edx_django_service/templates/edx/app/nginx/sites-available/concerns/proxy-to-app.j2 +++ b/playbooks/roles/edx_django_service/templates/edx/app/nginx/sites-available/concerns/proxy-to-app.j2 @@ -34,9 +34,6 @@ location @proxy_to_app { {% endif %} {% endif %} - # newrelic-specific header records the time when nginx handles a request. - proxy_set_header X-Queue-Start "t=${msec}"; - proxy_set_header Host $http_host; proxy_redirect off; diff --git a/playbooks/roles/edx_django_service/templates/edx/app/supervisor/conf.d.available/app-workers.conf.j2 b/playbooks/roles/edx_django_service/templates/edx/app/supervisor/conf.d.available/app-workers.conf.j2 index b7b9e3ca3..1a3027b34 100644 --- a/playbooks/roles/edx_django_service/templates/edx/app/supervisor/conf.d.available/app-workers.conf.j2 +++ b/playbooks/roles/edx_django_service/templates/edx/app/supervisor/conf.d.available/app-workers.conf.j2 @@ -3,7 +3,7 @@ {% for count in range(1, 1 + w.concurrency) %} [program:{{ w.queue }}_{{ count }}] -environment={% if COMMON_ENABLE_NEWRELIC_APP %}NEW_RELIC_APP_NAME={{ edx_django_service_newrelic_appname }}-workers,NEW_RELIC_DISTRIBUTED_TRACING_ENABLED={{ edx_django_service_enable_newrelic_distributed_tracing }},NEW_RELIC_LICENSE_KEY={{ NEWRELIC_LICENSE_KEY }},{% endif -%}CONCURRENCY=1,LOGLEVEL=info,DJANGO_SETTINGS_MODULE={{ worker_django_settings_module }},LANG={{ edx_django_service_lang }},PYTHONPATH={{ edx_django_service_code_dir }},BOTO_CONFIG="{{ edx_django_service_home }}/.boto",EDX_REST_API_CLIENT_NAME={{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ edx_django_service_name }}-worker-{{ w.queue }},DOCKER_WORKER_QUEUE={{ w.queue }},DOCKER_WORKER_NUM={{ count }} +environment=CONCURRENCY=1,LOGLEVEL=info,DJANGO_SETTINGS_MODULE={{ worker_django_settings_module }} user={{ common_web_user }} directory={{ edx_django_service_code_dir }} @@ -23,7 +23,7 @@ programs={%- for w in edx_django_service_workers %}{%- for c in range(1, 1 + w.c {% for w in edx_django_service_workers %} [program:{{ w.queue }}_{{ w.concurrency }}] -environment={% if COMMON_ENABLE_NEWRELIC_APP %}NEW_RELIC_APP_NAME={{ edx_django_service_newrelic_appname }}-workers,NEW_RELIC_DISTRIBUTED_TRACING_ENABLED={{ edx_django_service_enable_newrelic_distributed_tracing }},NEW_RELIC_LICENSE_KEY={{ NEWRELIC_LICENSE_KEY }},{% endif -%}CONCURRENCY={{ w.concurrency }},LOGLEVEL=info,DJANGO_SETTINGS_MODULE={{ worker_django_settings_module }},LANG={{ edx_django_service_lang }},PYTHONPATH={{ edx_django_service_code_dir }},BOTO_CONFIG="{{ edx_django_service_home }}/.boto",EDX_REST_API_CLIENT_NAME={{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ edx_django_service_name }}-worker-{{ w.queue }} +environment=CONCURRENCY={{ w.concurrency }},LOGLEVEL=info,DJANGO_SETTINGS_MODULE={{ worker_django_settings_module }},LANG={{ edx_django_service_lang }},PYTHONPATH={{ edx_django_service_code_dir }},BOTO_CONFIG="{{ edx_django_service_home }}/.boto",EDX_REST_API_CLIENT_NAME={{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ edx_django_service_name }}-worker-{{ w.queue }} user={{ common_web_user }} directory={{ edx_django_service_code_dir }} stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log diff --git a/playbooks/roles/edx_django_service_with_rendered_config/templates/edx/app/app/app.sh.j2 b/playbooks/roles/edx_django_service_with_rendered_config/templates/edx/app/app/app.sh.j2 index 0a7b94b2e..96e3fdc81 100644 --- a/playbooks/roles/edx_django_service_with_rendered_config/templates/edx/app/app/app.sh.j2 +++ b/playbooks/roles/edx_django_service_with_rendered_config/templates/edx/app/app/app.sh.j2 @@ -4,22 +4,7 @@ {% set edx_django_service_with_rendered_config_venv_bin = edx_django_service_with_rendered_config_venv_dir + "/bin" %} -{% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = edx_django_service_with_rendered_config_venv_bin + '/newrelic-admin run-program ' + edx_django_service_with_rendered_config_venv_bin + '/gunicorn' %} -{% else %} {% set executable = edx_django_service_with_rendered_config_venv_bin + '/gunicorn' %} -{% endif %} - -{% if COMMON_ENABLE_NEWRELIC_APP %} -export NEW_RELIC_DISTRIBUTED_TRACING_ENABLED="{{ edx_django_service_with_rendered_config_enable_newrelic_distributed_tracing }}" -export NEW_RELIC_APP_NAME="{{ edx_django_service_with_rendered_config_newrelic_appname }}" -if command -v ec2metadata >/dev/null 2>&1; then - INSTANCEID=$(ec2metadata --instance-id); - HOSTNAME=$(hostname) - export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="$HOSTNAME-$INSTANCEID" -fi -export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}" -{% endif -%} export EDX_REST_API_CLIENT_NAME="{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ edx_django_service_with_rendered_config_service_name }}" diff --git a/playbooks/roles/edx_notes_api/defaults/main.yml b/playbooks/roles/edx_notes_api/defaults/main.yml index 3da053356..2e35d146c 100644 --- a/playbooks/roles/edx_notes_api/defaults/main.yml +++ b/playbooks/roles/edx_notes_api/defaults/main.yml @@ -24,8 +24,6 @@ EDX_NOTES_API_MYSQL_PORT: "3306" EDX_NOTES_API_MYSQL_OPTIONS: connect_timeout: 10 EDX_NOTES_API_ELASTICSEARCH_URL: "localhost:9200" -EDX_NOTES_API_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-notes" -EDX_NOTES_API_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false EDX_NOTES_API_HOSTNAME: '~^((stage|prod)-)?notes.*' # Change these values!! diff --git a/playbooks/roles/edx_notes_api/templates/edx/app/edx_notes_api/edx_notes_api.sh.j2 b/playbooks/roles/edx_notes_api/templates/edx/app/edx_notes_api/edx_notes_api.sh.j2 index 179ba8e88..b1e07517a 100644 --- a/playbooks/roles/edx_notes_api/templates/edx/app/edx_notes_api/edx_notes_api.sh.j2 +++ b/playbooks/roles/edx_notes_api/templates/edx/app/edx_notes_api/edx_notes_api.sh.j2 @@ -3,17 +3,7 @@ # {{ ansible_managed }} {% set edx_notes_api_venv_bin = edx_notes_api_home + '/venvs/' + edx_notes_api_service_name + '/bin' %} -{% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = edx_notes_api_venv_bin + '/newrelic-admin run-program ' + edx_notes_api_venv_bin + '/gunicorn' %} -{% else %} {% set executable = edx_notes_api_venv_bin + '/gunicorn' %} -{% endif %} - -{% if COMMON_ENABLE_NEWRELIC_APP %} -export NEW_RELIC_DISTRIBUTED_TRACING_ENABLED="{{ EDX_NOTES_API_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}" -export NEW_RELIC_APP_NAME="{{ EDX_NOTES_API_NEWRELIC_APPNAME }}" -export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}" -{% endif -%} source {{ edx_notes_api_home }}/edx_notes_api_env diff --git a/playbooks/roles/enterprise_catalog/meta/main.yml b/playbooks/roles/enterprise_catalog/meta/main.yml index b30a81962..b3be8fe6f 100644 --- a/playbooks/roles/enterprise_catalog/meta/main.yml +++ b/playbooks/roles/enterprise_catalog/meta/main.yml @@ -44,7 +44,6 @@ dependencies: edx_django_service_automated_users: '{{ ENTERPRISE_CATALOG_AUTOMATED_USERS }}' edx_django_service_cors_whitelist: '{{ ENTERPRISE_CATALOG_CORS_ORIGIN_WHITELIST }}' edx_django_service_post_migrate_commands: '{{ enterprise_catalog_post_migrate_commands }}' - edx_django_service_enable_newrelic_distributed_tracing: '{{ ENTERPRISE_CATALOG_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' edx_django_service_decrypt_config_enabled: '{{ ENTERPRISE_CATALOG_DECRYPT_CONFIG_ENABLED }}' edx_django_service_copy_config_enabled: '{{ ENTERPRISE_CATALOG_COPY_CONFIG_ENABLED }}' edx_django_service_migration_check_services: '{{ enterprise_catalog_service_name }},{{ enterprise_catalog_service_name }}_workers' diff --git a/playbooks/roles/forum/defaults/main.yml b/playbooks/roles/forum/defaults/main.yml index 2d47cd02a..19b8eeae7 100644 --- a/playbooks/roles/forum/defaults/main.yml +++ b/playbooks/roles/forum/defaults/main.yml @@ -44,11 +44,6 @@ FORUM_OPENSEARCH_PORT: "9202" FORUM_OPENSEARCH_PROTOCOL: "http" FORUM_OPENSEARCH_URL: "{{ FORUM_OPENSEARCH_PROTOCOL }}://{{ FORUM_OPENSEARCH_HOST }}:{{ FORUM_OPENSEARCH_PORT }}" -# This needs to be a string, set to 'false' to disable -FORUM_NEW_RELIC_ENABLE: '{{ COMMON_ENABLE_NEWRELIC_APP }}' -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:edx-forum version:{{ app_version }}" @@ -83,9 +78,6 @@ forum_base_env: &forum_base_env MONGOID_AUTH_SOURCE: "{{ FORUM_MONGO_AUTH_DB }}" MONGOID_AUTH_MECH: "{{ FORUM_MONGO_AUTH_MECH }}" HOME: "{{ forum_app_dir }}" - NEW_RELIC_ENABLE: "{{ FORUM_NEW_RELIC_ENABLE }}" - NEW_RELIC_APP_NAME: "{{ FORUM_NEW_RELIC_APP_NAME }}" - NEW_RELIC_LICENSE_KEY: "{{ FORUM_NEW_RELIC_LICENSE_KEY }}" WORKER_PROCESSES: "{{ FORUM_WORKER_PROCESSES }}" DATA_DIR: "{{ forum_data_dir }}" LISTEN_HOST: "{{ FORUM_LISTEN_HOST }}" diff --git a/playbooks/roles/hermes/defaults/main.yml b/playbooks/roles/hermes/defaults/main.yml index 03859ab3f..25f00d0d8 100644 --- a/playbooks/roles/hermes/defaults/main.yml +++ b/playbooks/roles/hermes/defaults/main.yml @@ -83,4 +83,4 @@ HERMES_ALLOWED_SUDO_COMMANDS: - "{{ HERMES_COPY_COMMAND }}" - "{{ HERMES_RELOAD_COMMAND }}" -HERMES_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ hermes_service_name }}" +# HERMES_NEWRELIC_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ hermes_service_name }}" diff --git a/playbooks/roles/hermes/templates/hermes.sh.j2 b/playbooks/roles/hermes/templates/hermes.sh.j2 index f2171cc8e..17f3ddde8 100644 --- a/playbooks/roles/hermes/templates/hermes.sh.j2 +++ b/playbooks/roles/hermes/templates/hermes.sh.j2 @@ -3,21 +3,8 @@ # {{ ansible_managed }} source {{ hermes_app_dir }}/{{ hermes_service_name }}_env -{% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = hermes_venv_bin + '/newrelic-admin run-program ' + hermes_venv_bin + '/python' %} -{% else %} -{% set executable = hermes_venv_bin + '/python' %} -{% endif %} -{% if COMMON_ENABLE_NEWRELIC_APP %} -export NEW_RELIC_APP_NAME="{{ hermes_service_name }}" -if command -v ec2metadata >/dev/null 2>&1; then - INSTANCEID=$(ec2metadata --instance-id); - HOSTNAME=$(hostname) - export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="$HOSTNAME-$INSTANCEID" -fi -export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}" -{% endif -%} +{% set executable = hermes_venv_bin + '/python' %} # We exec so that hermes is the child of systemd and can be managed properly exec {{ executable }} {{ hermes_code_dir }}/hermes.py $@ diff --git a/playbooks/roles/hotg/templates/edx/app/hotg/Config.groovy.j2 b/playbooks/roles/hotg/templates/edx/app/hotg/Config.groovy.j2 index 118608c2c..30eb962a4 100644 --- a/playbooks/roles/hotg/templates/edx/app/hotg/Config.groovy.j2 +++ b/playbooks/roles/hotg/templates/edx/app/hotg/Config.groovy.j2 @@ -395,9 +395,3 @@ email { errorSubjectStart = 'Hammer Error: ' } -{% if NEWRELIC_API_KEY is defined and NEWRELIC_ACCOUNT_ID is defined %} -newrelic { - apiKey = '{{ NEWRELIC_API_KEY }}' - accountId = '{{ NEWRELIC_ACCOUNT_ID }}' -} -{% endif %} 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 1d8b34d1e..6a4913b42 100644 --- a/playbooks/roles/insights/templates/edx/app/insights/insights.sh.j2 +++ b/playbooks/roles/insights/templates/edx/app/insights/insights.sh.j2 @@ -6,14 +6,6 @@ {% set executable = insights_venv_bin + '/gunicorn' %} -{% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = insights_venv_bin + '/newrelic-admin run-program ' + insights_venv_bin + '/gunicorn' %} - -export NEW_RELIC_DISTRIBUTED_TRACING_ENABLED="{{ INSIGHTS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}" -export NEW_RELIC_APP_NAME="{{ INSIGHTS_NEWRELIC_APPNAME }}" -export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}" -{% endif -%} - {% if INSIGHTS_DATADOG_ENABLE %} {% set executable = insights_venv_bin + '/ddtrace-run ' + executable %} export DD_TAGS="service:edx-{{ insights_service_name }} version:{{ app_version }}" diff --git a/playbooks/roles/license_manager/meta/main.yml b/playbooks/roles/license_manager/meta/main.yml index 45d5c1922..865cf5aef 100644 --- a/playbooks/roles/license_manager/meta/main.yml +++ b/playbooks/roles/license_manager/meta/main.yml @@ -45,7 +45,6 @@ dependencies: edx_django_service_automated_users: '{{ LICENSE_MANAGER_AUTOMATED_USERS }}' edx_django_service_cors_whitelist: '{{ LICENSE_MANAGER_CORS_ORIGIN_WHITELIST }}' edx_django_service_post_migrate_commands: '{{ license_manager_post_migrate_commands }}' - edx_django_service_enable_newrelic_distributed_tracing: '{{ LICENSE_MANAGER_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' edx_django_service_api_root: '{{ LICENSE_MANAGER_API_ROOT }}' edx_django_service_decrypt_config_enabled: '{{ LICENSE_MANAGER_DECRYPT_CONFIG_ENABLED }}' edx_django_service_copy_config_enabled: '{{ LICENSE_MANAGER_COPY_CONFIG_ENABLED }}' diff --git a/playbooks/roles/mongo_newrelic_monitor/defaults/main.yml b/playbooks/roles/mongo_newrelic_monitor/defaults/main.yml index f3ec3ac97..119e36b7c 100644 --- a/playbooks/roles/mongo_newrelic_monitor/defaults/main.yml +++ b/playbooks/roles/mongo_newrelic_monitor/defaults/main.yml @@ -1,5 +1,5 @@ -MONGO_NEWRELIC_MONITOR_USER: 'newrelic-monitor' -MONGO_NEWRELIC_MONITOR_PASSWORD: 'SET-ME-PLEASE' -MONGO_NEWRELIC_USER_AUTH_SOURCE: 'admin' -MONGO_NEWRELIC_CLUSTER_NAME: 'mongo-cluster' -MONGO_NEWRELIC_LABELS: '{}' # eg '{ "env": "prod", "label": "my-label" }' +# MONGO_NEWRELIC_MONITOR_USER: 'newrelic-monitor' +# MONGO_NEWRELIC_MONITOR_PASSWORD: 'SET-ME-PLEASE' +# MONGO_NEWRELIC_USER_AUTH_SOURCE: 'admin' +# MONGO_NEWRELIC_CLUSTER_NAME: 'mongo-cluster' +# MONGO_NEWRELIC_LABELS: '{}' # eg '{ "env": "prod", "label": "my-label" }' diff --git a/playbooks/roles/mongo_newrelic_monitor/meta/main.yml b/playbooks/roles/mongo_newrelic_monitor/meta/main.yml index 2edccabac..23d65c7ef 100644 --- a/playbooks/roles/mongo_newrelic_monitor/meta/main.yml +++ b/playbooks/roles/mongo_newrelic_monitor/meta/main.yml @@ -1,3 +1,2 @@ --- -dependencies: - - newrelic_infrastructure +dependencies: [] diff --git a/playbooks/roles/mongo_newrelic_monitor/tasks/main.yml b/playbooks/roles/mongo_newrelic_monitor/tasks/main.yml index f472f0673..b6cf9d086 100644 --- a/playbooks/roles/mongo_newrelic_monitor/tasks/main.yml +++ b/playbooks/roles/mongo_newrelic_monitor/tasks/main.yml @@ -1,44 +1,3 @@ ---- - -- name: Install newrelic mongo integration - apt: - pkg: "{{ item }}" - state: present - update_cache: yes - with_items: - - "nri-mongodb" - -- name: Create newrelic monitoring role - shell: - cmd: 'mongo --authenticationDatabase admin -u "{{ MONGO_ADMIN_USER }}" -p "{{ MONGO_ADMIN_PASSWORD }}" --host "{{ MONGO_REPL_SET }}/{{ EDXAPP_MONGO_HOSTS }}" --eval ''db.createRole({ role: "listCollections", privileges: [{ resource: {db:"",collection:""}, actions: ["listCollections"] }], roles: [] });'' admin' - register: create_newrelic_role_result - ignore_errors: true - -- name: Fail if create newrelic monitoring role actually failed - fail: - msg: create newrelic monitoring role failed - when: 'create_newrelic_role_result.rc != 0 and "already exists" not in create_newrelic_role_result.stdout' - -- name: Create newrelic mongo user - mongodb_user: - login_database: "admin" - login_user: "{{ MONGO_ADMIN_USER }}" - login_password: "{{ MONGO_ADMIN_PASSWORD }}" - replica_set: "{{ MONGO_REPL_SET }}" - database: "admin" - name: "{{ MONGO_NEWRELIC_MONITOR_USER }}" - password: "{{ MONGO_NEWRELIC_MONITOR_PASSWORD }}" - roles: - - "clusterMonitor" - - "listCollections" - state: present - -- name: Copy newrelic mongo integration config - template: - src: "mongodb-config.yml.j2" - dest: "/etc/newrelic-infra/integrations.d/mongodb-config.yml" - backup: yes - - name: Restart the infrastructure agent to apply changes service: name: newrelic-infra diff --git a/playbooks/roles/mongo_newrelic_monitor/templates/mongodb-config.yml.j2 b/playbooks/roles/mongo_newrelic_monitor/templates/mongodb-config.yml.j2 index 788be0c2a..be33547a5 100644 --- a/playbooks/roles/mongo_newrelic_monitor/templates/mongodb-config.yml.j2 +++ b/playbooks/roles/mongo_newrelic_monitor/templates/mongodb-config.yml.j2 @@ -5,40 +5,40 @@ # # This is designed to be installed on the same instance as a mongo node. -integration_name: com.newrelic.mongodb +# integration_name: com.newrelic.mongodb -instances: - - name: all - # Available commands are "all", "metrics", and "inventory" - command: all - arguments: - cluster_name: '{{ MONGO_NEWRELIC_CLUSTER_NAME }}' - # The mongos to connect to - host: localhost - # The port the mongos is running on - port: 27017 - # The username of the user created to monitor the cluster. - # This user should exist on the cluster as a whole as well - # as on each of the individual mongods. - username: '{{ MONGO_NEWRELIC_MONITOR_USER }}' - # The password for the monitoring user - password: '{{ MONGO_NEWRELIC_MONITOR_PASSWORD }}' - # The database on which the monitoring user is stored - auth_source: '{{ MONGO_NEWRELIC_USER_AUTH_SOURCE }}' - # Connect using SSL - ssl: false - # Skip verification of the certificate sent by the host. - # This can make the connection susceptible to man-in-the-middle attacks, - # and should only be used for testing - #ssl_insecure_skip_verify: true - # Path to the CA certs file - #ssl_ca_certs: /sample/path/to/ca_certs - # Client Certificate to present to the server (optional) - #pem_key_file: /sample/file.pem - # Passphrase to decrypt PEMKeyFile file (optional) - #passphrase: secret - # A JSON map of database names to an array of collection names. If empty, - # defaults to all databases and collections. If the list of collections is null, - # collects all collections for the database. - filters: '' - labels: {{ MONGO_NEWRELIC_LABELS }} +# instances: +# - name: all +# # Available commands are "all", "metrics", and "inventory" +# command: all +# arguments: +# cluster_name: '{{ MONGO_NEWRELIC_CLUSTER_NAME }}' +# # The mongos to connect to +# host: localhost +# # The port the mongos is running on +# port: 27017 +# # The username of the user created to monitor the cluster. +# # This user should exist on the cluster as a whole as well +# # as on each of the individual mongods. +# username: '{{ MONGO_NEWRELIC_MONITOR_USER }}' +# # The password for the monitoring user +# password: '{{ MONGO_NEWRELIC_MONITOR_PASSWORD }}' +# # The database on which the monitoring user is stored +# auth_source: '{{ MONGO_NEWRELIC_USER_AUTH_SOURCE }}' +# # Connect using SSL +# ssl: false +# # Skip verification of the certificate sent by the host. +# # This can make the connection susceptible to man-in-the-middle attacks, +# # and should only be used for testing +# #ssl_insecure_skip_verify: true +# # Path to the CA certs file +# #ssl_ca_certs: /sample/path/to/ca_certs +# # Client Certificate to present to the server (optional) +# #pem_key_file: /sample/file.pem +# # Passphrase to decrypt PEMKeyFile file (optional) +# #passphrase: secret +# # A JSON map of database names to an array of collection names. If empty, +# # defaults to all databases and collections. If the list of collections is null, +# # collects all collections for the database. +# filters: '' +# labels: {{ MONGO_NEWRELIC_LABELS }} diff --git a/playbooks/roles/newrelic_infrastructure/defaults/main.yml b/playbooks/roles/newrelic_infrastructure/defaults/main.yml index 4833da321..7ff1ca458 100644 --- a/playbooks/roles/newrelic_infrastructure/defaults/main.yml +++ b/playbooks/roles/newrelic_infrastructure/defaults/main.yml @@ -14,21 +14,10 @@ # vars are namespace with the module name. # --- -NEWRELIC_INFRASTRUCTURE_LICENSE_KEY: "SPECIFY_KEY_HERE" -NEWRELIC_INFRASTRUCTURE_DEBIAN_REPO: 'deb https://download.newrelic.com/infrastructure_agent/linux/apt {{ ansible_distribution_release }} main' -NEWRELIC_INFRASTRUCTURE_DEBIAN_REPO_XENIAL: 'deb https://download.newrelic.com/infrastructure_agent/linux/apt xenial main' -NEWRELIC_INFRASTRUCTURE_DEBIAN_REPO_BIONIC: 'deb https://download.newrelic.com/infrastructure_agent/linux/apt bionic main' -NEWRELIC_INFRASTRUCTURE_KEY_URL: 'https://download.newrelic.com/infrastructure_agent/gpg/newrelic-infra.gpg' - -# This data structure will be written into /etc/newrelic-infra/logging.d/logs.yml -NEWRELIC_LOGS: !!null # Any extra config you want to specify -# https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/infrastructure-config-file-template-newrelic-infrayml -NEWRELIC_INFRASTRUCTURE_EXTRA_CONFIG: '' -NEWRELIC_INFRASTRUCTURE_AMAZON_REPO: 'https://download.newrelic.com/infrastructure_agent/linux/yum/el/6/x86_64' # -# OS packages +# OS package # newrelic_infrastructure_debian_pkgs: diff --git a/playbooks/roles/newrelic_infrastructure/files/edx/bin/write_nr_display_name_config.sh b/playbooks/roles/newrelic_infrastructure/files/edx/bin/write_nr_display_name_config.sh index 9488a6ed1..ff77b8757 100644 --- a/playbooks/roles/newrelic_infrastructure/files/edx/bin/write_nr_display_name_config.sh +++ b/playbooks/roles/newrelic_infrastructure/files/edx/bin/write_nr_display_name_config.sh @@ -1,18 +1,18 @@ #! /usr/bin/env bash -if command -v ec2metadata >/dev/null 2>&1; then - INSTANCEID=$(ec2metadata --instance-id); - HOSTNAME=$(hostname) - DISPLAY_NAME="$HOSTNAME-$INSTANCEID" - if [[ -f /etc/newrelic/nrsysmond.cfg ]]; then - sudo sed -i 's/^hostname=.*//g' /etc/newrelic/nrsysmond.cfg - echo "hostname=\"$DISPLAY_NAME\"" | sudo tee -a /etc/newrelic/nrsysmond.cfg - sudo service newrelic-sysmond restart - fi - if [[ -f /etc/newrelic-infra.yml ]]; then - sudo sed -i 's/^display_name: .*//g' /etc/newrelic-infra.yml - echo "display_name: \"$DISPLAY_NAME\"" | sudo tee -a /etc/newrelic-infra.yml - sudo service newrelic-infra restart - fi -fi +#if command -v ec2metadata >/dev/null 2>&1; then +# INSTANCEID=$(ec2metadata --instance-id); +# HOSTNAME=$(hostname) +# DISPLAY_NAME="$HOSTNAME-$INSTANCEID" +# if [[ -f /etc/newrelic/nrsysmond.cfg ]]; then +# sudo sed -i 's/^hostname=.*//g' /etc/newrelic/nrsysmond.cfg +# echo "hostname=\"$DISPLAY_NAME\"" | sudo tee -a /etc/newrelic/nrsysmond.cfg +# sudo service newrelic-sysmond restart +# fi +# if [[ -f /etc/newrelic-infra.yml ]]; then +# sudo sed -i 's/^display_name: .*//g' /etc/newrelic-infra.yml +# echo "display_name: \"$DISPLAY_NAME\"" | sudo tee -a /etc/newrelic-infra.yml +# sudo service newrelic-infra restart +# fi +#fi diff --git a/playbooks/roles/newrelic_infrastructure/tasks/main.yml b/playbooks/roles/newrelic_infrastructure/tasks/main.yml index 49b10ba44..9081cf79e 100644 --- a/playbooks/roles/newrelic_infrastructure/tasks/main.yml +++ b/playbooks/roles/newrelic_infrastructure/tasks/main.yml @@ -7,168 +7,10 @@ # code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions # license: https://github.com/openedx/configuration/blob/master/LICENSE.TXT # -# newrelic_infrastructure -# -# Overview: -# -# Installs the New Relic Infrastructure service https://newrelic.com/infrastructure -## -# Dependencies: -# -# Example play: -# roles: -# - common -# - newrelic_infrastructure -# -# -- name: install license key - template: - src: etc/newrelic-infra.j2 - dest: /etc/newrelic-infra.yml - mode: 0600 - register: license_key_file - tags: - - install - - install:configuration - -- name: Add apt key for New Relic Infrastructure - apt_key: - url: "{{ NEWRELIC_INFRASTRUCTURE_KEY_URL }}" - state: present - tags: - - install - - install:app-requirements - when: ansible_distribution == 'Ubuntu' - retries: 10 - delay: 10 - register: nr_apt_key - until: nr_apt_key is succeeded - -# For focal, use the bionic repo for now. -- name: Install apt repository for New Relic Infrastructure if neither bionic nor focal - apt_repository: - repo: "{{ NEWRELIC_INFRASTRUCTURE_DEBIAN_REPO }}" - state: present - update_cache: yes - tags: - - install - - install:app-requirements - when: ansible_distribution == 'Ubuntu' and (ansible_distribution_release != 'bionic' and ansible_distribution_release != 'focal') - retries: 10 - delay: 10 - register: nr_apt_repo - until: nr_apt_repo is succeeded - -- name: Install apt repository for New Relic Infrastructure if bionic - apt_repository: - repo: "{{ NEWRELIC_INFRASTRUCTURE_DEBIAN_REPO_BIONIC }}" - state: present - update_cache: yes - tags: - - install - - install:app-requirements - when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'bionic' - retries: 10 - delay: 10 - register: nr_apt_repo_bionic - until: nr_apt_repo_bionic is succeeded -# For focal, use the bionic repo for now. -- name: Install apt repository for New Relic Infrastructure if focal - apt_repository: - repo: "{{ NEWRELIC_INFRASTRUCTURE_DEBIAN_REPO_BIONIC }}" - state: present - update_cache: yes - tags: - - install - - install:app-requirements - when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'focal' - retries: 10 - delay: 10 - register: nr_apt_repo_focal - until: nr_apt_repo_focal is succeeded - -- name: Install newrelic related system packages for Ubuntu - apt: - name: "{{ newrelic_infrastructure_debian_pkgs }}" - install_recommends: yes - state: latest - tags: - - install - - install:app-requirements - when: ansible_distribution == 'Ubuntu' - retries: 10 - delay: 10 - register: nr_apt_pkg - until: nr_apt_pkg is succeeded - -- name: Configure the New Relic Servers yum repository - yum_repository: - name: "newrelic-infra" - baseurl: "{{ NEWRELIC_INFRASTRUCTURE_AMAZON_REPO }}" - gpgkey: "{{ NEWRELIC_INFRASTRUCTURE_KEY_URL }}" - gpgcheck: "yes" - state: present - description: New Relic Infrastructure - tags: - - install - - install:app-requirements - when: ansible_distribution == 'Amazon' - retries: 10 - delay: 10 - register: nr_yum_repo - until: nr_yum_repo is succeeded - -- name: Install newrelic related system packages for Amazon - yum: - name: "{{ newrelic_infrastructure_redhat_pkgs }}" - enablerepo: "newrelic-infra" - state: latest - update_cache: yes - tags: - - install - - install:app-requirements - when: ansible_distribution == 'Amazon' - retries: 10 - delay: 10 - register: nr_yum_pkg - until: nr_yum_pkg is succeeded - -- name: Install newrelic display name script - copy: - src: "edx/bin/write_nr_display_name_config.sh" - dest: "/edx/bin/write_nr_display_name_config.sh" - owner: root - group: root - mode: u=rwx,g=r,o=r - -- name: configure logging - template: - src: etc/newrelic-infra/logging.d/logs.yml.j2 - dest: /etc/newrelic-infra/logging.d/logs.yml - mode: 0600 - tags: - - install - - install:configuration - when: NEWRELIC_LOGS +# # In Ubuntu>16.04, /etc/rc.local doesn't exist by default. Since this script isn't # used by the GoCD instance using Ubuntu 18.04, skip this task when running on Bionic. -# See OPS-3341 and http://manpages.ubuntu.com/manpages/bionic/man8/systemd-rc-local-generator.8.html -- name: Run newrelic display name script on boot - lineinfile: - dest: "/etc/rc.local" - line: "/edx/bin/write_nr_display_name_config.sh" - insertbefore: "exit 0" - mode: "u+x,g+x" - when: ansible_distribution_release != 'bionic' and ansible_distribution_release != 'focal' - -- name: Restart the infrastructure agent if the license key changes - service: - name: newrelic-infra - state: restarted - when: license_key_file.changed - tags: - - install - - install:configuration +# See OPS-3341 and http://manpages.ubuntu.com/manpages/bionic/man8/systemd-rc-local-generator.8.html \ No newline at end of file diff --git a/playbooks/roles/newrelic_infrastructure/templates/etc/newrelic-infra.j2 b/playbooks/roles/newrelic_infrastructure/templates/etc/newrelic-infra.j2 index dc9996dff..e69de29bb 100644 --- a/playbooks/roles/newrelic_infrastructure/templates/etc/newrelic-infra.j2 +++ b/playbooks/roles/newrelic_infrastructure/templates/etc/newrelic-infra.j2 @@ -1,2 +0,0 @@ -license_key: {{ NEWRELIC_INFRASTRUCTURE_LICENSE_KEY }} -{{ NEWRELIC_INFRASTRUCTURE_EXTRA_CONFIG }} diff --git a/playbooks/roles/newrelic_infrastructure/templates/etc/newrelic-infra/logging.d/logs.yml.j2 b/playbooks/roles/newrelic_infrastructure/templates/etc/newrelic-infra/logging.d/logs.yml.j2 index b52a6fabf..c7f738d04 100644 --- a/playbooks/roles/newrelic_infrastructure/templates/etc/newrelic-infra/logging.d/logs.yml.j2 +++ b/playbooks/roles/newrelic_infrastructure/templates/etc/newrelic-infra/logging.d/logs.yml.j2 @@ -1 +1,2 @@ -{{ NEWRELIC_LOGS | to_nice_yaml }} +# {{ NEWRELIC_LOGS | to_nice_yaml }} # Removed as part of New Relic cleanup + diff --git a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/analytics_api.j2 b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/analytics_api.j2 index ccafcc823..c7d59e5c6 100644 --- a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/analytics_api.j2 +++ b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/analytics_api.j2 @@ -52,9 +52,6 @@ location @proxy_to_app { proxy_set_header X-Forwarded-Port $http_x_forwarded_port; proxy_set_header X-Forwarded-For $http_x_forwarded_for; - # newrelic-specific header records the time when nginx handles a request. - proxy_set_header X-Queue-Start "t=${msec}"; - proxy_set_header Host $http_host; proxy_redirect off; diff --git a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms_proxy.j2 b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms_proxy.j2 index 664f9f5ee..f8f33d77e 100644 --- a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms_proxy.j2 +++ b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/cms_proxy.j2 @@ -14,9 +14,6 @@ {% endif %} {% endif %} - # newrelic-specific header records the time when nginx handles a request. - proxy_set_header X-Queue-Start "t=${msec}"; - proxy_set_header Host $http_host; proxy_redirect off; diff --git a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_notes_api.j2 b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_notes_api.j2 index 5f94acdbb..a4b03e770 100644 --- a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_notes_api.j2 +++ b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/edx_notes_api.j2 @@ -52,9 +52,6 @@ location @proxy_to_app { proxy_set_header X-Forwarded-Port $http_x_forwarded_port; proxy_set_header X-Forwarded-For $http_x_forwarded_for; - # newrelic-specific header records the time when nginx handles a request. - proxy_set_header X-Queue-Start "t=${msec}"; - proxy_set_header Host $http_host; proxy_redirect off; diff --git a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/forum.j2 b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/forum.j2 index 718a6e602..12501231a 100644 --- a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/forum.j2 +++ b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/forum.j2 @@ -57,9 +57,6 @@ location @proxy_to_app { proxy_set_header X-Forwarded-For $http_x_forwarded_for; {% endif %} - # newrelic-specific header records the time when nginx handles a request. - proxy_set_header X-Queue-Start "t=${msec}"; - proxy_set_header Host $http_host; proxy_redirect off; diff --git a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/grafana.j2 b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/grafana.j2 index 33cb6a1a3..dce20f34b 100644 --- a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/grafana.j2 +++ b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/grafana.j2 @@ -36,9 +36,6 @@ server { proxy_set_header X-Forwarded-For $http_x_forwarded_for; {% endif %} - # newrelic-specific header records the time when nginx handles a request. - proxy_set_header X-Queue-Start "t=${msec}"; - proxy_set_header Host $http_host; proxy_redirect off; diff --git a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/graphite.j2 b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/graphite.j2 index cd94520db..be69589a0 100644 --- a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/graphite.j2 +++ b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/graphite.j2 @@ -43,9 +43,6 @@ server { proxy_set_header X-Forwarded-For $http_x_forwarded_for; {% endif %} - # newrelic-specific header records the time when nginx handles a request. - proxy_set_header X-Queue-Start "t=${msec}"; - proxy_set_header Host $http_host; proxy_redirect off; diff --git a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2 b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2 index 8bef747fd..11f2bd573 100644 --- a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2 +++ b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/insights.j2 @@ -80,9 +80,6 @@ location @proxy_to_app { proxy_set_header X-Forwarded-Port $http_x_forwarded_port; proxy_set_header X-Forwarded-For $http_x_forwarded_for; - # newrelic-specific header records the time when nginx handles a request. - proxy_set_header X-Queue-Start "t=${msec}"; - proxy_set_header Host $http_host; proxy_redirect off; diff --git a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms_proxy.j2 b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms_proxy.j2 index 4c6c75676..8f5264c2a 100644 --- a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms_proxy.j2 +++ b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/lms_proxy.j2 @@ -14,9 +14,6 @@ {% endif %} {% endif %} - # newrelic-specific header records the time when nginx handles a request. - proxy_set_header X-Queue-Start "t=${msec}"; - proxy_set_header Host $http_host; proxy_redirect off; diff --git a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xqueue.j2 b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xqueue.j2 index 28d96272d..ff04e92cc 100644 --- a/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xqueue.j2 +++ b/playbooks/roles/nginx/templates/edx/app/nginx/sites-available/xqueue.j2 @@ -54,9 +54,6 @@ location @proxy_to_app { proxy_set_header X-Forwarded-Port $http_x_forwarded_port; proxy_set_header X-Forwarded-For $http_x_forwarded_for; - # newrelic-specific header records the time when nginx handles a request. - proxy_set_header X-Queue-Start "t=${msec}"; - proxy_set_header Host $http_host; proxy_redirect off; diff --git a/playbooks/roles/prospectus/defaults/main.yml b/playbooks/roles/prospectus/defaults/main.yml index 9577543f0..01a136841 100644 --- a/playbooks/roles/prospectus/defaults/main.yml +++ b/playbooks/roles/prospectus/defaults/main.yml @@ -16,9 +16,6 @@ PROSPECTUS_ENVIRONMENT: !!null PROSPECTUS_OAUTH_ID: !!null PROSPECTUS_OAUTH_SECRET: !!null -PROSPECTUS_NEW_RELIC_LICENSE_KEY: 'fake-key' -PROSPECTUS_NEW_RELIC_APP_ID: 'fake-id' - PROSPECTUS_CONTENTFUL_SPACE_ID: 'fake-key' PROSPECTUS_CONTENTFUL_ACCESS_TOKEN: 'fake-key' PROSPECTUS_CONTENTFUL_ENVIRONMENT: 'master' diff --git a/playbooks/roles/prospectus/templates/.env.environment.j2 b/playbooks/roles/prospectus/templates/.env.environment.j2 index fcc8ba4ae..317f6c5b8 100644 --- a/playbooks/roles/prospectus/templates/.env.environment.j2 +++ b/playbooks/roles/prospectus/templates/.env.environment.j2 @@ -3,9 +3,6 @@ OAUTH_ID={{ PROSPECTUS_OAUTH_ID }} OAUTH_SECRET={{ PROSPECTUS_OAUTH_SECRET }} -NEW_RELIC_LICENSE_KEY={{ PROSPECTUS_NEW_RELIC_LICENSE_KEY }} -NEW_RELIC_APP_ID={{ PROSPECTUS_NEW_RELIC_APP_ID }} - GATSBY_CONTENTFUL_SPACE_ID={{ PROSPECTUS_CONTENTFUL_SPACE_ID }} GATSBY_CONTENTFUL_ACCESS_TOKEN={{ PROSPECTUS_CONTENTFUL_ACCESS_TOKEN }} GATSBY_SEGMENT_WRITE_KEY={{ PROSPECTUS_SEGMENT_WRITE_KEY }} diff --git a/playbooks/roles/registrar/meta/main.yml b/playbooks/roles/registrar/meta/main.yml index b1dc40d88..0a77aa382 100644 --- a/playbooks/roles/registrar/meta/main.yml +++ b/playbooks/roles/registrar/meta/main.yml @@ -45,7 +45,7 @@ dependencies: edx_django_service_automated_users: '{{ REGISTRAR_AUTOMATED_USERS }}' edx_django_service_cors_whitelist: '{{ REGISTRAR_CORS_ORIGIN_WHITELIST }}' edx_django_service_post_migrate_commands: '{{ registrar_post_migrate_commands }}' - edx_django_service_enable_newrelic_distributed_tracing: '{{ REGISTRAR_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' + # edx_django_service_enable_newrelic_distributed_tracing: '{{ REGISTRAR_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}' edx_django_service_api_root: '{{ REGISTRAR_API_ROOT }}' edx_django_service_decrypt_config_enabled: '{{ REGISTRAR_DECRYPT_CONFIG_ENABLED }}' edx_django_service_copy_config_enabled: '{{ REGISTRAR_COPY_CONFIG_ENABLED }}' diff --git a/playbooks/roles/xqueue/templates/xqueue.conf.j2 b/playbooks/roles/xqueue/templates/xqueue.conf.j2 index c83c0036c..94a2e8125 100644 --- a/playbooks/roles/xqueue/templates/xqueue.conf.j2 +++ b/playbooks/roles/xqueue/templates/xqueue.conf.j2 @@ -1,10 +1,4 @@ -[program:xqueue] - -{% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = xqueue_venv_bin + '/newrelic-admin run-program ' + xqueue_venv_bin + '/gunicorn' %} -{% else %} {% set executable = xqueue_venv_bin + '/gunicorn' %} -{% endif %} {% if XQUEUE_DATADOG_ENABLE %} {% set executable = xqueue_venv_bin + '/ddtrace-run ' + executable %} @@ -17,7 +11,7 @@ directory={{ xqueue_code_dir }} # 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={{ XQUEUE_NEWRELIC_APPNAME }},NEW_RELIC_LICENSE_KEY={{ NEWRELIC_LICENSE_KEY }},{% endif -%}{% if XQUEUE_DATADOG_ENABLE %}DD_DJANGO_USE_HANDLER_RESOURCE_FORMAT=true,DD_TAGS="service:{{ XQUEUE_DATADOG_APPNAME }} version:{{ app_version }}",DD_TRACE_LOG_STREAM_HANDLER=false,DD_PROFILING_ENABLED=true,DD_DATA_STREAMS_ENABLED=true,DD_LOGS_INJECTION=true,DD_SERVICE="{{ XQUEUE_DATADOG_APPNAME }}",{% endif -%}PID=/var/tmp/xqueue.pid,PORT={{ xqueue_gunicorn_port }},ADDRESS={{ xqueue_gunicorn_host }},LANG={{ XQUEUE_LANG }},DJANGO_SETTINGS_MODULE=xqueue.{{ XQUEUE_SETTINGS }},XQUEUE_CFG={{ COMMON_CFG_DIR }}/xqueue.yml +environment={% if XQUEUE_DATADOG_ENABLE %}DD_DJANGO_USE_HANDLER_RESOURCE_FORMAT=true,DD_TAGS="service:{{ XQUEUE_DATADOG_APPNAME }} version:{{ app_version }}",DD_TRACE_LOG_STREAM_HANDLER=false,DD_PROFILING_ENABLED=true,DD_DATA_STREAMS_ENABLED=true,DD_LOGS_INJECTION=true,DD_SERVICE="{{ XQUEUE_DATADOG_APPNAME }}",{% endif -%}PID=/var/tmp/xqueue.pid,PORT={{ xqueue_gunicorn_port }},ADDRESS={{ xqueue_gunicorn_host }},LANG={{ XQUEUE_LANG }},DJANGO_SETTINGS_MODULE=xqueue.{{ XQUEUE_SETTINGS }},XQUEUE_CFG={{ COMMON_CFG_DIR }}/xqueue.yml stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log diff --git a/playbooks/roles/xqueue/templates/xqueue_consumer.conf.j2 b/playbooks/roles/xqueue/templates/xqueue_consumer.conf.j2 index df68e10c1..102506438 100644 --- a/playbooks/roles/xqueue/templates/xqueue_consumer.conf.j2 +++ b/playbooks/roles/xqueue/templates/xqueue_consumer.conf.j2 @@ -1,23 +1,17 @@ [program:xqueue_consumer] -{% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = xqueue_venv_bin + '/newrelic-admin run-program ' + xqueue_venv_bin + '/django-admin run_consumer' %} -{% else %} {% set executable = xqueue_venv_bin + '/django-admin run_consumer' %} -{% endif %} {% if XQUEUE_DATADOG_ENABLE %} {% set executable = xqueue_venv_bin + '/ddtrace-run ' + executable %} -{% endif -%} +{% endif %} command={{ executable }} --pythonpath={{ xqueue_code_dir }} --settings=xqueue.{{ XQUEUE_SETTINGS }} user={{ common_web_user }} directory={{ xqueue_code_dir }} - -# 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_STARTUP_TIMEOUT=10,NEW_RELIC_APP_NAME={{ XQUEUE_CONSUMER_NEWRELIC_APPNAME }},NEW_RELIC_LICENSE_KEY={{ NEWRELIC_LICENSE_KEY }},{% endif -%}{% if XQUEUE_DATADOG_ENABLE %}DD_DJANGO_USE_HANDLER_RESOURCE_FORMAT=true,DD_TAGS="service:{{ XQUEUE_CONSUMER_DATADOG_APPNAME }} version:{{ app_version }}",DD_TRACE_LOG_STREAM_HANDLER=false,DD_PROFILING_ENABLED=true,DD_DATA_STREAMS_ENABLED=true,DD_LOGS_INJECTION=true,DD_SERVICE="{{ XQUEUE_CONSUMER_DATADOG_APPNAME }}",{% endif -%}LANG={{ XQUEUE_LANG }},XQUEUE_CFG={{ COMMON_CFG_DIR }}/xqueue.yml + +environment={% if XQUEUE_DATADOG_ENABLE %}DD_DJANGO_USE_HANDLER_RESOURCE_FORMAT=true,DD_TAGS="service:{{ XQUEUE_CONSUMER_DATADOG_APPNAME }} version:{{ app_version }}",DD_TRACE_LOG_STREAM_HANDLER=false,DD_PROFILING_ENABLED=true,DD_DATA_STREAMS_ENABLED=true,DD_LOGS_INJECTION=true,DD_SERVICE="{{ XQUEUE_CONSUMER_DATADOG_APPNAME }}",{% endif -%}LANG={{ XQUEUE_LANG }},XQUEUE_CFG={{ COMMON_CFG_DIR }}/xqueue.yml stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log diff --git a/playbooks/roles/xqwatcher/defaults/main.yml b/playbooks/roles/xqwatcher/defaults/main.yml index 71210c987..65eefdf8c 100644 --- a/playbooks/roles/xqwatcher/defaults/main.yml +++ b/playbooks/roles/xqwatcher/defaults/main.yml @@ -72,7 +72,7 @@ XQWATCHER_REPOS: # depends upon Newrelic being enabled via COMMON_ENABLE_NEWRELIC # and a key being provided via NEWRELIC_LICENSE_KEY -XQWATCHER_NEWRELIC_APPNAME: "{{ COMMON_DEPLOYMENT }}-{{ COMMON_ENVIRONMENT }}-xqwatcher" +# XQWATCHER_NEWRELIC_APPNAME: "{{ COMMON_DEPLOYMENT }}-{{ COMMON_ENVIRONMENT }}-xqwatcher" XQWATCHER_PIP_EXTRA_ARGS: "-i {{ COMMON_PYPI_MIRROR_URL }}" XQWATCHER_DATADOG_APPNAME: "edx-{{ xqwatcher_service_name }}" diff --git a/playbooks/roles/xqwatcher/tasks/main.yml b/playbooks/roles/xqwatcher/tasks/main.yml index a755b2b66..eed9abf3f 100644 --- a/playbooks/roles/xqwatcher/tasks/main.yml +++ b/playbooks/roles/xqwatcher/tasks/main.yml @@ -33,7 +33,6 @@ # - aws # - datadog # - splunkforwarder -# - newrelic # - xqwatcher # # You would use a commone like the following to run the play. 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 6a5866742..0da207186 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 @@ -3,11 +3,7 @@ # {% set xqwatcher_venv_dir = xqwatcher_app_dir + '/venvs/' + xqwatcher_service_name %} -{% if COMMON_ENABLE_NEWRELIC_APP %} -{% set executable = xqwatcher_venv_dir + '/bin/newrelic-admin run-program ' + xqwatcher_venv_dir + '/bin/python' %} -{% else %} {% set executable = xqwatcher_venv_dir + '/bin/python' %} -{% endif %} {% if XQWATCHER_DATADOG_ENABLE %} {% set executable = xqwatcher_venv_dir + '/bin/ddtrace-run ' + executable %} {% endif -%} @@ -21,6 +17,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 XQWATCHER_DATADOG_ENABLE %}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,DD_LOGS_INJECTION=true,DD_SERVICE="{{ XQWATCHER_DATADOG_APPNAME }}",{% endif -%} +environment={% if XQWATCHER_DATADOG_ENABLE %}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,DD_LOGS_INJECTION=true,DD_SERVICE="{{ XQWATCHER_DATADOG_APPNAME }}",{% endif -%} killasgroup=true stopasgroup=true diff --git a/playbooks/sample_vars/server_vars.yml b/playbooks/sample_vars/server_vars.yml index 7e99adf96..c39519635 100644 --- a/playbooks/sample_vars/server_vars.yml +++ b/playbooks/sample_vars/server_vars.yml @@ -10,6 +10,7 @@ # github: true # type: admin #USER_CMD_PROMPT: '[$name_tag] ' +# REMOVED NEW RELIC SETTINGS #COMMON_ENABLE_NEWRELIC_APP: $enable_newrelic #COMMON_ENABLE_DATADOG: $enable_datadog #FORUM_NEW_RELIC_ENABLE: $enable_newrelic diff --git a/playbooks/tools_jenkins.yml b/playbooks/tools_jenkins.yml index 57848d95a..d101254a8 100644 --- a/playbooks/tools_jenkins.yml +++ b/playbooks/tools_jenkins.yml @@ -35,5 +35,3 @@ # crcSalt: - role: splunkforwarder when: COMMON_ENABLE_SPLUNKFORWARDER - - role: newrelic_infrastructure - when: COMMON_ENABLE_NEWRELIC_INFRASTRUCTURE