mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 11:19:49 -04:00
Enable turning off browser monitoring when new relic is disabled
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import json
|
import json
|
||||||
from os import getenv
|
from os import getenv
|
||||||
|
|
||||||
|
import newrelic.agent
|
||||||
import pytz
|
import pytz
|
||||||
|
|
||||||
from app.cloudfoundry_config import cloud_config
|
from app.cloudfoundry_config import cloud_config
|
||||||
@@ -33,6 +34,8 @@ class Config(object):
|
|||||||
NR_AGENT_ID = getenv('NR_AGENT_ID')
|
NR_AGENT_ID = getenv('NR_AGENT_ID')
|
||||||
NR_APP_ID = getenv('NR_APP_ID')
|
NR_APP_ID = getenv('NR_APP_ID')
|
||||||
NR_BROWSER_KEY = getenv('NR_BROWSER_KEY')
|
NR_BROWSER_KEY = getenv('NR_BROWSER_KEY')
|
||||||
|
settings = newrelic.agent.global_settings()
|
||||||
|
NR_MONITOR_ON = settings and settings.monitor_mode
|
||||||
|
|
||||||
TEMPLATE_PREVIEW_API_HOST = getenv('TEMPLATE_PREVIEW_API_HOST', 'http://localhost:9999')
|
TEMPLATE_PREVIEW_API_HOST = getenv('TEMPLATE_PREVIEW_API_HOST', 'http://localhost:9999')
|
||||||
TEMPLATE_PREVIEW_API_KEY = getenv('TEMPLATE_PREVIEW_API_KEY', 'my-secret-key')
|
TEMPLATE_PREVIEW_API_KEY = getenv('TEMPLATE_PREVIEW_API_KEY', 'my-secret-key')
|
||||||
|
|||||||
@@ -10,7 +10,10 @@
|
|||||||
<title>{% block pageTitle %}U.S. Notify{% endblock %}</title>
|
<title>{% block pageTitle %}U.S. Notify{% endblock %}</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||||
<meta name="theme-color" content="{{ themeColor | default('#0b0c0c') }}" /> {# Hardcoded value of $govuk-black #}
|
<meta name="theme-color" content="{{ themeColor | default('#0b0c0c') }}" /> {# Hardcoded value of $govuk-black #}
|
||||||
{% include "partials/newrelic.html" -%}
|
{% if config['NR_MONITOR_ON'] %}
|
||||||
|
{% include "partials/newrelic.html" -%}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{# Ensure that older IE versions always render with the correct rendering engine #}
|
{# Ensure that older IE versions always render with the correct rendering engine #}
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ distributed_tracing.enabled = true
|
|||||||
# application and reports this data to the New Relic UI at
|
# application and reports this data to the New Relic UI at
|
||||||
# newrelic.com. This global switch is normally overridden for
|
# newrelic.com. This global switch is normally overridden for
|
||||||
# each environment below.
|
# each environment below.
|
||||||
monitor_mode = true
|
monitor_mode = false
|
||||||
|
|
||||||
# Sets the name of a file to log agent messages to. Useful for
|
# Sets the name of a file to log agent messages to. Useful for
|
||||||
# debugging any issues with the agent. This is not set by
|
# debugging any issues with the agent. This is not set by
|
||||||
|
|||||||
Reference in New Issue
Block a user