Skip to content

Manually instrument NewRelic browser monitoring bundle - #16158

Merged
wjordan merged 2 commits into
stagingfrom
newrelic_instrument
Jun 30, 2017
Merged

Manually instrument NewRelic browser monitoring bundle#16158
wjordan merged 2 commits into
stagingfrom
newrelic_instrument

Conversation

@wjordan

@wjordan wjordan commented Jun 29, 2017

Copy link
Copy Markdown
Contributor

Since #15988 and #16031 (inlined CSS and font into HTML head), our homepage HTML head is larger than newrelic_rpm browser-monitoring auto-instrumentation's hard-coded limit of 50_000 (uncompressed) bytes causing browser monitoring to no longer work on this page, so we need to switch from auto-instrumentation to manual instrumentation as a workaround.

This PR disables newrelic auto-instrumentation of the browser-monitoring JS bundle by fixing a (apparently long-standing) bug in our newrelic.yml.erb template, where the browser_monitoring.auto_instrument flag was intended to be set to false but was not being written correctly and so defaulted to true.

We already include the manual-instrumenting code (::NewRelic::Agent.browser_timing_header rescue '') in application.html.haml in Dashboard, which was causing the New Relic JS bundle to be inserted into the HTML twice.

In Pegasus, I've added the manual-instrumenting code to theme_common_head_after.haml so the bundle will still be included after auto-instrumenting is disabled.

@wjordan
wjordan merged commit af87ea2 into staging Jun 30, 2017
@wjordan
wjordan deleted the newrelic_instrument branch June 30, 2017 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant