newrelic: insert browser timing header manually.

Insert the <script> tag that monitors browser timing into the <head>
manually. This is to avoid this error:

    Skipping RUM instrumentation. Unable to find <body> tag in first 50000 bytes of document.

See also https://docs.newrelic.com/docs/agents/ruby-agent/features/new-relic-browser-ruby-agent/#manual_instrumentation
This commit is contained in:
evazion
2021-09-26 23:14:14 -05:00
parent 1f77e6980a
commit a2a4ab887d
3 changed files with 3 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<%= NewRelic::Agent.browser_timing_header rescue "" %>
<meta charset="utf-8">
<title><%= page_title %></title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">

View File

@@ -1,6 +1,7 @@
<!doctype html>
<html lang="en">
<head>
<%= NewRelic::Agent.browser_timing_header rescue "" %>
<meta charset="utf-8">
<title><%= page_title %></title>

View File

@@ -9,6 +9,7 @@ if Danbooru.config.new_relic_license_key.present?
log_level: Danbooru.config.debug_mode ? "debug" : "error",
#log: Rails.logger,
"rake.tasks": ["maintenance:.*"],
"browser_monitoring.auto_instrument": false,
config: Rails.application.config,
)
end