Module: NewRelic::Agent::BrowserMonitoring

Included in:
Agent
Defined in:
lib/new_relic/agent/browser_monitoring.rb

Overview

This module contains support for Real User Monitoring - the javascript generation and configuration

Defined Under Namespace

Classes: DummyMetricFrame

Constant Summary collapse

@@dummy_metric_frame =
DummyMetricFrame.new

Instance Method Summary collapse

Instance Method Details

This method returns a string suitable for inclusion in a page

  • known as ‘manual instrumentation’ for Real User

Monitoring. Can return either a script tag with associated javascript, or in the case of disabled Real User Monitoring, an empty string

This is the footer string - it should be placed as low in the page as is reasonably possible.



51
52
53
54
55
56
# File 'lib/new_relic/agent/browser_monitoring.rb', line 51

def browser_timing_footer
  config = NewRelic::Agent.instance.beacon_configuration
  return "" if config.nil? || !config.rum_enabled || config.browser_monitoring_key.nil?
  return "" if !NewRelic::Agent.is_transaction_traced? || !NewRelic::Agent.is_execution_traced?
  generate_footer_js(config)
end

#browser_timing_headerObject

This method returns a string suitable for inclusion in a page

  • known as ‘manual instrumentation’ for Real User

Monitoring. Can return either a script tag with associated javascript, or in the case of disabled Real User Monitoring, an empty string

This is the header string - it should be placed as high in the page as is reasonably possible - that is, before any style or javascript inclusions, but after any header-related meta tags



36
37
38
39
40
41
# File 'lib/new_relic/agent/browser_monitoring.rb', line 36

def browser_timing_header
  return "" if NewRelic::Agent.instance.beacon_configuration.nil?
  return "" if !NewRelic::Agent.is_transaction_traced? || !NewRelic::Agent.is_execution_traced?

  NewRelic::Agent.instance.beacon_configuration.browser_timing_header
end