Skip to content

Commit

Permalink
Manually added NewRelic JS snippet to fix CSP and enable browser moni…
Browse files Browse the repository at this point in the history
…toring (#1719)

* Disable automatic js insertion of NewRelic browser client

* Adding newrelic js snippets for staging/prod
  • Loading branch information
jimleroyer authored Nov 14, 2023
1 parent 0b6e0bc commit 864a1c0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/templates/main_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<head>
<meta charset="utf-8"/>
<title>{% block page_title %}Notification{% endblock %}</title>
{% include 'partials/newrelic-head.html' %}
{% include 'partials/google-tag-manager-head.html' %}
{% include 'partials/qualtrics-head.html' %}

Expand Down
1 change: 1 addition & 0 deletions app/templates/notify_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<head>
<meta charset="utf-8" />
<title>{% block page_title %}Notify{% endblock %}</title>
{% include 'partials/newrelic-head.html' %}
{% include 'partials/google-tag-manager-head.html' %}
<link
rel="shortcut icon"
Expand Down
19 changes: 19 additions & 0 deletions app/templates/partials/newrelic-head.html

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions gunicorn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import newrelic.agent # See https://bit.ly/2xBVKBH

newrelic.agent.initialize() # noqa: E402
# Disable NewRelic 'Real User Monitoring' instrumentation on the browser-side.
# See: https://docs.newrelic.com/docs/apm/agents/python-agent/configuration/python-agent-configuration/#disable_browser_autorum
newrelic.agent.disable_browser_autorum()

# Guincorn sets the server type on our app. We don't want to show it in the header in the response.
gunicorn.SERVER = 'Undisclosed'
Expand Down

0 comments on commit 864a1c0

Please sign in to comment.