Skip to content

Commit

Permalink
feat: Remove New Relic support in edxapp role (#77)
Browse files Browse the repository at this point in the history
Removes all matches for `ack -i 'new.?relic' playbooks/roles/edxapp`
  • Loading branch information
timmc-edx authored Oct 15, 2024
1 parent 6eee5c7 commit c07808e
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 96 deletions.
8 changes: 0 additions & 8 deletions playbooks/roles/edxapp/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -630,14 +630,6 @@ EDXAPP_XML_FROM_GIT: false
EDXAPP_XML_S3_BUCKET: !!null
EDXAPP_XML_S3_KEY: !!null

# Whether to enable newrelic APM for edxapp webapp or worker processes.
EDXAPP_NEWRELIC_ENABLE: false
EDXAPP_NEWRELIC_LMS_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-edxapp-lms"
EDXAPP_NEWRELIC_CMS_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-edxapp-cms"
EDXAPP_NEWRELIC_WORKERS_APPNAME: "{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-edxapp-workers"
EDXAPP_LMS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false
EDXAPP_CMS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false
EDXAPP_WORKERS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false
EDXAPP_DATADOG_ENABLE: "{{COMMON_ENABLE_DATADOG and COMMON_ENABLE_DATADOG_APP}}"
# ddtrace 2.7.9 contains a fix for a pymongo incompatibility.
# (Same fix is present in 2.8.2 on the 2.8.x release line.)
Expand Down
1 change: 0 additions & 1 deletion playbooks/roles/edxapp/tasks/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
mode: "{{ item.mode }}"
with_items:
- { src: 'edxapp_env.j2', dest: '{{ edxapp_app_dir }}/edxapp_env', owner: '{{ edxapp_user }}', group: '{{ common_web_user }}', mode: '0644' }
- { src: 'newrelic.ini.j2', dest: '{{ edxapp_app_dir }}/newrelic.ini', owner: '{{ edxapp_user }}', group: '{{ common_web_user }}', mode: '0644' }
- { src: 'git_ssh.sh.j2', dest: '{{ edxapp_git_ssh }}', owner: '{{ edxapp_user }}', group: '{{ edxapp_user }}', mode: '0750' }
- { src: 'boto.j2', dest: '{{ edxapp_app_dir }}/.boto', owner: '{{ edxapp_user }}', group: '{{ common_web_user }}', mode: '0644' }
tags:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,7 @@

{% set edxapp_venv_bin = edxapp_venv_dir + "/bin" %}
source {{ edxapp_app_dir }}/edxapp_env
{% if EDXAPP_NEWRELIC_ENABLE %}
{% set executable = edxapp_venv_bin + '/newrelic-admin run-program ' + edxapp_venv_bin + '/single-beat ' + edxapp_venv_bin + '/celery' %}

export NEW_RELIC_CONFIG_FILE="{{ edxapp_app_dir }}/newrelic.ini"
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
{% else %}
{% set executable = edxapp_venv_bin + '/single-beat ' + edxapp_venv_bin + '/celery' %}
{% endif %}

# We exec so that celery is the child of supervisor and can be managed properly

Expand Down
14 changes: 0 additions & 14 deletions playbooks/roles/edxapp/templates/edx/app/edxapp/cms.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,6 @@

{% set executable = edxapp_venv_bin + '/gunicorn' %}

{% if EDXAPP_NEWRELIC_ENABLE %}
{% set executable = edxapp_venv_bin + '/newrelic-admin run-program ' + executable %}

export NEW_RELIC_DISTRIBUTED_TRACING_ENABLED="{{ EDXAPP_CMS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}"
export NEW_RELIC_APP_NAME="{{ EDXAPP_NEWRELIC_CMS_APPNAME }}"
export NEW_RELIC_CONFIG_FILE="{{ edxapp_app_dir }}/newrelic.ini"
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 -%}

{% if EDXAPP_DATADOG_ENABLE %}
{% set executable = edxapp_venv_bin + '/ddtrace-run ' + executable %}
export DD_TAGS="service:edx-edxapp-cms version:{{ app_version }}"
Expand Down
15 changes: 0 additions & 15 deletions playbooks/roles/edxapp/templates/edx/app/edxapp/lms.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@

{% set executable = edxapp_venv_bin + '/gunicorn' %}

{% if EDXAPP_NEWRELIC_ENABLE %}
{% set executable = edxapp_venv_bin + '/newrelic-admin run-program ' + executable %}

export NEW_RELIC_DISTRIBUTED_TRACING_ENABLED="{{ EDXAPP_LMS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }}"
export NEW_RELIC_APP_NAME="{{ EDXAPP_NEWRELIC_LMS_APPNAME }}"
export NEW_RELIC_CONFIG_FILE="{{ edxapp_app_dir }}/newrelic.ini"
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 -%}

{% if EDXAPP_DATADOG_ENABLE %}
{% set executable = edxapp_venv_bin + '/ddtrace-run ' + executable %}
export DD_TAGS="service:edx-edxapp-lms version:{{ app_version }}"
Expand Down
10 changes: 0 additions & 10 deletions playbooks/roles/edxapp/templates/edx/app/edxapp/worker.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@
{% set edxapp_venv_bin = edxapp_venv_dir + "/bin" %}
source {{ edxapp_app_dir }}/edxapp_env
{% set executable = edxapp_venv_bin + '/celery' %}
{% if EDXAPP_NEWRELIC_ENABLE %}
{% set executable = edxapp_venv_bin + '/newrelic-admin run-program ' + executable %}

export NEW_RELIC_CONFIG_FILE="{{ edxapp_app_dir }}/newrelic.ini"
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
{% endif %}

{% if EDXAPP_DATADOG_ENABLE %}
{% set executable = edxapp_venv_bin + '/ddtrace-run ' + executable %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% for w in edxapp_workers %}
[program:{{ w.service_variant }}_{{ w.queue }}_{{ w.concurrency }}]

environment={% if EDXAPP_NEWRELIC_ENABLE %}NEW_RELIC_APP_NAME={{ EDXAPP_NEWRELIC_WORKERS_APPNAME }}-{{ w.service_variant }},NEW_RELIC_DISTRIBUTED_TRACING_ENABLED={{ EDXAPP_WORKERS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }},NEW_RELIC_LICENSE_KEY={{ NEWRELIC_LICENSE_KEY }},{% endif -%}CONCURRENCY={{ w.concurrency }},LOGLEVEL=info,DJANGO_SETTINGS_MODULE={{ w.service_variant }}.envs.{{ worker_django_settings_module }},LANG={{ EDXAPP_LANG }},PYTHONPATH={{ edxapp_code_dir }},SERVICE_VARIANT={{ w.service_variant }},BOTO_CONFIG="{{ edxapp_app_dir }}/.boto",EDX_REST_API_CLIENT_NAME=edx.{{ w.service_variant }}.core.{{ w.queue }},QUEUE_NAME={{ w.service_variant }}.core.{{ w.queue }}
environment=CONCURRENCY={{ w.concurrency }},LOGLEVEL=info,DJANGO_SETTINGS_MODULE={{ w.service_variant }}.envs.{{ worker_django_settings_module }},LANG={{ EDXAPP_LANG }},PYTHONPATH={{ edxapp_code_dir }},SERVICE_VARIANT={{ w.service_variant }},BOTO_CONFIG="{{ edxapp_app_dir }}/.boto",EDX_REST_API_CLIENT_NAME=edx.{{ w.service_variant }}.core.{{ w.queue }},QUEUE_NAME={{ w.service_variant }}.core.{{ w.queue }}
user={{ common_web_user }}
directory={{ edxapp_code_dir }}
stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log
Expand All @@ -20,11 +20,6 @@ programs={%- for w in edxapp_workers %}{{ w.service_variant }}_{{ w.queue }}_{{
{% if EDXAPP_ENABLE_CELERY_BEAT|bool and EDXAPP_CELERY_BROKER_TRANSPORT == "redis" %}
[program:celerybeat_scheduler]
environment=
{% if EDXAPP_NEWRELIC_ENABLE %}
NEW_RELIC_APP_NAME={{ EDXAPP_NEWRELIC_WORKERS_APPNAME }}-lms,
NEW_RELIC_DISTRIBUTED_TRACING_ENABLED={{ EDXAPP_WORKERS_ENABLE_NEWRELIC_DISTRIBUTED_TRACING }},
NEW_RELIC_LICENSE_KEY={{ NEWRELIC_LICENSE_KEY }},
{% endif -%}
LANG={{ EDXAPP_LANG }},
PYTHONPATH={{ edxapp_code_dir }},
SERVICE_VARIANT=lms,
Expand Down
31 changes: 0 additions & 31 deletions playbooks/roles/edxapp/templates/newrelic.ini.j2

This file was deleted.

0 comments on commit c07808e

Please sign in to comment.