Skip to content

Commit

Permalink
feat: allow apps provisioned with edx_django_service to override COMM… (
Browse files Browse the repository at this point in the history
#49)

* feat: allow apps provisioned with edx_django_service to override COMMON_ENABLE_NEWRELIC_APP

* chore: bool flip everything

* chore: simplify some variables
  • Loading branch information
christopappas authored Jun 25, 2024
1 parent 2dee0b0 commit 30c67c3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions playbooks/roles/ecommerce/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ ECOMMERCE_ENABLE_ADMIN_URLS_RESTRICTION: false
ECOMMERCE_ADMIN_URLS:
- admin

ECOMMERCE_ENABLE_NEWRELIC_APP: true
ECOMMERCE_ENABLE_NEWRELIC_DISTRIBUTED_TRACING: false

# Python 3 conversion
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/ecommerce/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ 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_decrypt_config_enabled: '{{ ECOMMERCE_DECRYPT_CONFIG_ENABLED }}'
edx_django_service_copy_config_enabled: '{{ ECOMMERCE_COPY_CONFIG_ENABLED }}'
Expand Down
1 change: 1 addition & 0 deletions playbooks/roles/edx_django_service/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ edx_django_service_basic_auth_exempted_paths_extra: []
edx_django_service_basic_auth_exempted_paths: '{{ edx_django_service_basic_auth_exempted_paths_default + edx_django_service_basic_auth_exempted_paths_extra }}'

edx_django_service_newrelic_appname: '{{ COMMON_ENVIRONMENT }}-{{ COMMON_DEPLOYMENT }}-{{ edx_django_service_name }}'
edx_django_service_enable_newrelic_app: '{{ COMMON_ENABLE_NEWRELIC_APP }}'
edx_django_service_enable_newrelic_distributed_tracing: false
edx_django_datadog_service: 'edx-{{ edx_django_service_name }}'
edx_django_service_datadog_enable: '{{ COMMON_ENABLE_DATADOG and (COMMON_ENABLE_DATADOG_APP or edx_django_service_name in COMMON_ENABLE_DATADOG_APP_SERVICES) }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

{% if COMMON_ENABLE_NEWRELIC_APP %}
{% 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 }}"
Expand Down Expand Up @@ -53,7 +53,7 @@ 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 COMMON_ENABLE_NEWRELIC_APP %}
{% 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 \
Expand Down

0 comments on commit 30c67c3

Please sign in to comment.