Commit d0203f76 by e0d

Working newrelic

parent ed7a06be
......@@ -212,8 +212,10 @@ EDXAPP_XML_FROM_GIT: false
EDXAPP_XML_S3_BUCKET: !!null
EDXAPP_XML_S3_KEY: !!null
EDXAPP_ENABLE_NEWRELIC: true
EDXAPP_NEWRELIC_EXECUTABLE: "/opt/edx/bin/newrelic-admin"
EDXAPP_ENABLE_NEWRELIC: false
EDXAPP_NEWRELIC_LICENSE: "YOUR LICENSE"
EDXAPP_NEWRELIC_APPNAME: "YOUR APPNAME"
edxapp_newrelic_executable: "{{ edxapp_venv_dir }}/bin/newrelic-admin"
#-------- Everything below this line is internal to the role ------------
#Use YAML references (& and *) and hash merge <<: to factor out shared settings
......
[program:cms]
{% if EDXAPP_ENABLE_NEWRELIC %}
{% set executable = edxapp_venv_dir + '/bin/gunicorn' %}
{% set executable = edxapp_newrelic_executable + ' run-program ' + edxapp_venv_dir + '/bin/gunicorn' %}
{% else %}
{% set executable = '/opt/edx/bin/newrelic-admin run-program' + edxapp_venv_dir + '/bin/gunicorn' %}
{% set executable = edxapp_venv_dir + '/bin/gunicorn' %}
{% endif %}
{% if ansible_processor|length > 0 %}
command=executable --preload -b {{ edxapp_cms_gunicorn_host }}:{{ edxapp_cms_gunicorn_port }} -w {{ ansible_processor|length * worker_core_mult.cms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} cms.wsgi
command={{ executable }} --preload -b {{ edxapp_cms_gunicorn_host }}:{{ edxapp_cms_gunicorn_port }} -w {{ ansible_processor|length * worker_core_mult.cms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} cms.wsgi
{% else %}
command=executable --preload -b {{ edxapp_cms_gunicorn_host }}:{{ edxapp_cms_gunicorn_port }} -w {{ worker_core_mult.cms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} cms.wsgi
command={{ executable }} --preload -b {{ edxapp_cms_gunicorn_host }}:{{ edxapp_cms_gunicorn_port }} -w {{ worker_core_mult.cms }} --timeout=300 --pythonpath={{ edxapp_code_dir }} cms.wsgi
{% endif %}
user={{ common_web_user }}
directory={{ edxapp_code_dir }}
environment=PORT={{edxapp_cms_gunicorn_port}},ADDRESS={{edxapp_cms_gunicorn_host}},LANG={{ EDXAPP_LANG }},DJANGO_SETTINGS_MODULE={{ edxapp_cms_env }},SERVICE_VARIANT="cms"
environment=PORT={{edxapp_cms_gunicorn_port}},ADDRESS={{edxapp_cms_gunicorn_host}},LANG={{ EDXAPP_LANG }},DJANGO_SETTINGS_MODULE={{ edxapp_cms_env }},SERVICE_VARIANT="cms",NEW_RELIC_APP_NAME={{ EDXAPP_NEWRELIC_APPNAME }},NEW_RELIC_LICENSE_KEY={{ EDXAPP_NEWRELIC_LICENSE }}
stdout_logfile={{ supervisor_log_dir }}/%(program_name)-stdout.log
stderr_logfile={{ supervisor_log_dir }}/%(program_name)-stderr.log
killasgroup=true
......
[program:lms]
{% if EDXAPP_ENABLE_NEWRELIC %}
{% set executable = EDXAPP_NEWRELIC_EXECUTABLE + 'run-program' + edxapp_venv_dir + '/bin/gunicorn' %}
{% set executable = edxapp_newrelic_executable + ' run-program ' + edxapp_venv_dir + '/bin/gunicorn' %}
{% else %}
{% set executable = edxapp_venv_dir + '/bin/gunicorn' %}
{% endif %}
......@@ -14,7 +14,7 @@ command={{ executable }} --preload -b {{ edxapp_lms_gunicorn_host }}:{{ edxapp_l
user={{ common_web_user }}
directory={{ edxapp_code_dir }}
environment=PORT={{edxapp_lms_gunicorn_port}},ADDRESS={{edxapp_lms_gunicorn_host}},LANG={{ EDXAPP_LANG }},DJANGO_SETTINGS_MODULE={{ edxapp_lms_env }},SERVICE_VARIANT="lms"
environment=PORT={{edxapp_lms_gunicorn_port}},ADDRESS={{edxapp_lms_gunicorn_host}},LANG={{ EDXAPP_LANG }},DJANGO_SETTINGS_MODULE={{ edxapp_lms_env }},SERVICE_VARIANT="lms",NEW_RELIC_APP_NAME={{ EDXAPP_NEWRELIC_APPNAME }},NEW_RELIC_LICENSE_KEY={{ EDXAPP_NEWRELIC_LICENSE }}
stdout_logfile={{ supervisor_log_dir }}/%(program_name)-stdout.log
stderr_logfile={{ supervisor_log_dir }}/%(program_name)-stderr.log
killasgroup=true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment