newrelic_rpm 3.1.0.beta1 → 3.1.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of newrelic_rpm might be problematic. Click here for more details.
- data/CHANGELOG +8 -2
- data/README.rdoc +28 -28
- data/bin/mongrel_rpm +1 -1
- data/lib/new_relic/agent.rb +24 -23
- data/lib/new_relic/agent/agent.rb +13 -11
- data/lib/new_relic/agent/beacon_configuration.rb +12 -8
- data/lib/new_relic/agent/browser_monitoring.rb +2 -2
- data/lib/new_relic/agent/error_collector.rb +1 -1
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +2 -2
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +1 -1
- data/lib/new_relic/commands/deployments.rb +1 -1
- data/lib/new_relic/control/configuration.rb +1 -1
- data/lib/new_relic/delayed_job_injection.rb +5 -4
- data/lib/new_relic/histogram.rb +1 -1
- data/lib/new_relic/noticed_error.rb +1 -1
- data/lib/new_relic/rack/browser_monitoring.rb +7 -1
- data/lib/new_relic/rack/metric_app.rb +1 -0
- data/lib/new_relic/rack/mongrel_rpm.ru +2 -0
- data/lib/new_relic/recipes.rb +1 -1
- data/lib/new_relic/transaction_sample.rb +3 -2
- data/lib/new_relic/transaction_sample/segment.rb +4 -3
- data/lib/new_relic/version.rb +1 -1
- data/newrelic.yml +26 -26
- data/newrelic_rpm.gemspec +14 -19
- data/test/active_record_fixtures.rb +1 -1
- data/test/new_relic/agent/agent/connect_test.rb +6 -6
- data/test/new_relic/agent/agent/start_test.rb +1 -1
- data/test/new_relic/agent/agent/start_worker_thread_test.rb +1 -1
- data/test/new_relic/agent/agent_test.rb +43 -0
- data/test/new_relic/agent/beacon_configuration_test.rb +18 -35
- data/test/new_relic/agent/browser_monitoring_test.rb +17 -6
- data/test/new_relic/agent/error_collector/notice_error_test.rb +1 -1
- data/test/new_relic/rack/all_test.rb +11 -0
- data/ui/views/newrelic/_show_sample_sql.rhtml +1 -1
- data/ui/views/newrelic/index.rhtml +1 -1
- metadata +20 -25
- data/test/new_relic/rack/episodes_test.rb +0 -318
data/CHANGELOG
CHANGED
@@ -1,5 +1,11 @@
|
|
1
|
-
v3.1.0
|
2
|
-
* Experimental support for aggregating data from short-running
|
1
|
+
v3.1.0
|
2
|
+
* Experimental support for aggregating data from short-running
|
3
|
+
processes using NewRelic::Agent.load_data and
|
4
|
+
NewRelic::Agent.save_data
|
5
|
+
|
6
|
+
v3.0.1
|
7
|
+
* Updated Real User Monitoring to reduce javascript size and improve
|
8
|
+
compatibility, fix a few known bugs
|
3
9
|
|
4
10
|
v3.0.0
|
5
11
|
* Support for Real User Monitoring
|
data/README.rdoc
CHANGED
@@ -1,15 +1,13 @@
|
|
1
|
-
= New Relic
|
1
|
+
= New Relic Ruby Agent
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
information about the performance of your Ruby on Rails or Merb
|
8
|
-
application as it runs in production. The New Relic Agent is
|
3
|
+
New Relic is a performance management system, developed by
|
4
|
+
New Relic, Inc (http://www.newrelic.com). It provides you with deep
|
5
|
+
information about the performance of your Rails or Ruby
|
6
|
+
application as it runs in production. The New Relic Ruby Agent is
|
9
7
|
dual-purposed as a either a Rails plugin or a Gem, hosted on
|
10
8
|
github[http://github.com/newrelic/rpm/tree/master].
|
11
9
|
|
12
|
-
The New Relic Agent runs in one of two modes:
|
10
|
+
The New Relic Ruby Agent runs in one of two modes:
|
13
11
|
|
14
12
|
==== Production Mode
|
15
13
|
|
@@ -25,17 +23,16 @@ automatically in Rails applications.
|
|
25
23
|
|
26
24
|
== Supported Environments
|
27
25
|
|
28
|
-
* Ruby 1.8.
|
29
|
-
* JRuby 1.4
|
26
|
+
* Ruby 1.8.7, 1.9.1, or 1.9.2, including REE
|
27
|
+
* JRuby 1.4 or higher
|
30
28
|
* Rails 2.0 or later for Production Mode
|
31
|
-
* Rails 2.
|
32
|
-
* Merb 1.0 or later
|
29
|
+
* Rails 2.3 or later for Developer Mode
|
33
30
|
* Sinatra
|
34
31
|
* Rack
|
35
32
|
|
36
33
|
Any Rack based framework should work but may not be tested. Install
|
37
|
-
|
38
|
-
any problems to support@newrelic.com.
|
34
|
+
the Ruby Agent as a gem and add the Developer Mode middleware if
|
35
|
+
desired. Report any problems to support@newrelic.com.
|
39
36
|
|
40
37
|
You can also monitor non-web applications. Refer to the "Other
|
41
38
|
Environments" section under "Getting Started".
|
@@ -48,7 +45,7 @@ install the gem as a plug-in--details below.
|
|
48
45
|
gem install newrelic_rpm
|
49
46
|
|
50
47
|
To monitor your applications in production, create an account at
|
51
|
-
http://newrelic.com/
|
48
|
+
http://newrelic.com/ . There you can
|
52
49
|
sign up for a free Lite account or one of our paid subscriptions.
|
53
50
|
|
54
51
|
Once you receive the welcome e-mail with a license key and
|
@@ -86,7 +83,7 @@ to your init.rb file.
|
|
86
83
|
|
87
84
|
=== Sinatra Installation
|
88
85
|
|
89
|
-
To use
|
86
|
+
To use the Ruby Agent with a Sinatra app, add
|
90
87
|
require 'newrelic_rpm'
|
91
88
|
in your Sinatra app, below the Sinatra require directive.
|
92
89
|
|
@@ -99,7 +96,7 @@ the middleware stack. See the +config.ru+ sample below.
|
|
99
96
|
|
100
97
|
=== Other Environments
|
101
98
|
|
102
|
-
You can use
|
99
|
+
You can use the Ruby Agent to monitor any Ruby application. Add
|
103
100
|
require 'newrelic_rpm'
|
104
101
|
to your startup sequence and then manually start the agent using
|
105
102
|
NewRelic::Agent.manual_start
|
@@ -107,7 +104,7 @@ to your startup sequence and then manually start the agent using
|
|
107
104
|
To instrument Rack based applications, refer to the docs in
|
108
105
|
NewRelic::Agent::Instrumentation::Rack.
|
109
106
|
|
110
|
-
Refer to the docs in
|
107
|
+
Refer to the docs in New Relic for details on how to monitor other web
|
111
108
|
frameworks, background jobs, and daemons.
|
112
109
|
|
113
110
|
Also, see if your environment is already supported by the
|
@@ -115,7 +112,7 @@ rpm_contrib[http://newrelic.github.com/rpm_contrib] gem.
|
|
115
112
|
|
116
113
|
== Developer Mode
|
117
114
|
|
118
|
-
When running the
|
115
|
+
When running the Developer Mode, the Ruby Agent will track the
|
119
116
|
performance of every HTTP request serviced by your application, and
|
120
117
|
store in memory this information for the last 100 HTTP transactions.
|
121
118
|
|
@@ -132,9 +129,10 @@ all environments but +development+.
|
|
132
129
|
|
133
130
|
==== Developer Mode in Rails
|
134
131
|
|
135
|
-
Developer Mode is available automatically in Rails Applications
|
136
|
-
|
137
|
-
|
132
|
+
Developer Mode is available automatically in Rails Applications based
|
133
|
+
on Rails 2.3 and later. No additional configuration is required. When
|
134
|
+
your application starts and +developer_mode+ is enabled, the Ruby
|
135
|
+
Agent injects a middleware into your Rails middleware stack.
|
138
136
|
|
139
137
|
For earlier versions of Rails that support Rack, you can use
|
140
138
|
a +config.ru+ as below.
|
@@ -148,15 +146,14 @@ middleware. This middleware passes all requests that do not start with
|
|
148
146
|
|
149
147
|
Here's an example entry for Developer Mode in a +config.ru+ file:
|
150
148
|
|
151
|
-
require 'new_relic/
|
149
|
+
require 'new_relic/rack/developer_mode'
|
152
150
|
use NewRelic::Rack::DeveloperMode
|
153
151
|
|
154
|
-
|
155
152
|
== Production Mode
|
156
153
|
|
157
154
|
When your application runs in the production environment, the New
|
158
|
-
Relic agent runs in production mode. It connects to the New Relic
|
159
|
-
service and sends deep performance data to the
|
155
|
+
Relic agent runs in production mode. It connects to the New Relic
|
156
|
+
service and sends deep performance data to the UI for your
|
160
157
|
analysis. To view this data, log in to http://rpm.newrelic.com.
|
161
158
|
|
162
159
|
NOTE: You must have a valid account and license key to view this data
|
@@ -165,10 +162,13 @@ online. Refer to instructions in *Getting Started*, below.
|
|
165
162
|
|
166
163
|
= Support
|
167
164
|
|
168
|
-
Reach out to us--and to fellow
|
165
|
+
Reach out to us--and to fellow users--at
|
169
166
|
support.newrelic.com[http://support.newrelic.com/discussions/support].
|
170
167
|
There you'll find documentation, FAQs, and forums where you can submit
|
171
|
-
suggestions and discuss
|
168
|
+
suggestions and discuss New Relic with staff and other users.
|
169
|
+
|
170
|
+
Also available is community support on IRC: we generally use #newrelic
|
171
|
+
on irc.freenode.net
|
172
172
|
|
173
173
|
Find a bug? E-mail support@newrelic.com, or post it to
|
174
174
|
support.newrelic.com[http://support.newrelic.com/discussions/support].
|
data/bin/mongrel_rpm
CHANGED
@@ -11,7 +11,7 @@ OptionParser.new do |opts|
|
|
11
11
|
opts.banner = "Usage: #{File.basename($0)} [options] [app_name]"
|
12
12
|
opts.on("-p", "--port=port", Integer, "default: #{port}") { | port | }
|
13
13
|
opts.on("--[no-]logging", "turn off request logging" ) { | l | options[:logging] = l }
|
14
|
-
opts.on("--license=
|
14
|
+
opts.on("--license=license_key", "override license key" ) { | l | options[:license_key] = l }
|
15
15
|
opts.on("--install", "install a newrelic.yml template" ) { | l | options[:install] = true }
|
16
16
|
opts.separator ""
|
17
17
|
opts.separator "app_name is the name of the application where the metrics will be stored"
|
data/lib/new_relic/agent.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
require 'new_relic/control'
|
2
|
-
|
2
|
+
require 'new_relic/data_serialization'
|
3
|
+
# = New Relic Ruby Agent
|
3
4
|
#
|
4
|
-
# New Relic
|
5
|
-
#
|
6
|
-
#
|
5
|
+
# New Relic is a performance monitoring application for applications
|
6
|
+
# running in production. For more information on New Relic please visit
|
7
|
+
# http://www.newrelic.com.
|
7
8
|
#
|
8
|
-
# The New Relic Agent can be installed in Rails applications to
|
9
|
-
# runtime performance metrics, traces, and errors for display
|
10
|
-
# Developer Mode
|
11
|
-
# or for monitoring and analysis at http://rpm.newrelic.com
|
12
|
-
# about any Ruby application.
|
9
|
+
# The New Relic Ruby Agent can be installed in Rails applications to
|
10
|
+
# gather runtime performance metrics, traces, and errors for display
|
11
|
+
# in a Developer Mode middleware (mapped to /newrelic in your application
|
12
|
+
# server) or for monitoring and analysis at http://rpm.newrelic.com
|
13
|
+
# with just about any Ruby application.
|
13
14
|
#
|
14
15
|
# == Getting Started
|
15
16
|
# For instructions on installation and setup, see
|
@@ -20,18 +21,18 @@ require 'new_relic/control'
|
|
20
21
|
# To instrument Rack middlwares or Metal apps, refer to the docs in
|
21
22
|
# NewRelic::Agent::Instrumentation::Rack.
|
22
23
|
#
|
23
|
-
# == Agent API
|
24
|
+
# == Ruby Agent API
|
24
25
|
#
|
25
|
-
# For details on the Agent API, refer to NewRelic::Agent.
|
26
|
+
# For details on the Ruby Agent API, refer to NewRelic::Agent.
|
26
27
|
#
|
27
|
-
# == Customizing
|
28
|
+
# == Customizing the Ruby Agent
|
28
29
|
#
|
29
|
-
# For detailed information on customizing the
|
30
|
+
# For detailed information on customizing the Ruby Agent
|
30
31
|
# please visit our {support and documentation site}[http://support.newrelic.com].
|
31
32
|
#
|
32
33
|
module NewRelic
|
33
|
-
# == Agent APIs
|
34
|
-
# This module contains the public API methods for the Agent.
|
34
|
+
# == Ruby Agent APIs
|
35
|
+
# This module contains the public API methods for the Ruby Agent.
|
35
36
|
#
|
36
37
|
# For adding custom instrumentation to method invocations, refer to
|
37
38
|
# the docs in the class NewRelic::Agent::MethodTracer.
|
@@ -39,7 +40,7 @@ module NewRelic
|
|
39
40
|
# For information on how to customize the controller
|
40
41
|
# instrumentation, or to instrument something other than Rails so
|
41
42
|
# that high level dispatcher actions or background tasks show up as
|
42
|
-
# first class operations in
|
43
|
+
# first class operations in New Relic, refer to
|
43
44
|
# NewRelic::Agent::Instrumentation::ControllerInstrumentation and
|
44
45
|
# NewRelic::Agent::Instrumentation::ControllerInstrumentation::ClassMethods.
|
45
46
|
#
|
@@ -155,10 +156,10 @@ module NewRelic
|
|
155
156
|
# not auto-start.
|
156
157
|
#
|
157
158
|
# When the app environment loads, so does the Agent. However, the
|
158
|
-
# Agent will only connect to
|
159
|
+
# Agent will only connect to the service if a web front-end is found. If
|
159
160
|
# you want to selectively monitor ruby processes that don't use
|
160
161
|
# web plugins, then call this method in your code and the Agent
|
161
|
-
# will fire up and start reporting to
|
162
|
+
# will fire up and start reporting to the service.
|
162
163
|
#
|
163
164
|
# Options are passed in as overrides for values in the
|
164
165
|
# newrelic.yml, such as app_name. In addition, the option +log+
|
@@ -313,10 +314,10 @@ module NewRelic
|
|
313
314
|
Thread::current[:record_sql] != false
|
314
315
|
end
|
315
316
|
|
316
|
-
# Set a filter to be applied to errors that
|
317
|
-
# block should evalute to the exception to track
|
318
|
-
# different from the original exception) or nil to
|
319
|
-
# exception.
|
317
|
+
# Set a filter to be applied to errors that the Ruby Agent will
|
318
|
+
# track. The block should evalute to the exception to track
|
319
|
+
# (which could be different from the original exception) or nil to
|
320
|
+
# ignore this exception.
|
320
321
|
#
|
321
322
|
# The block is yielded to with the exception to filter.
|
322
323
|
#
|
@@ -326,7 +327,7 @@ module NewRelic
|
|
326
327
|
agent.error_collector.ignore_error_filter(&block)
|
327
328
|
end
|
328
329
|
|
329
|
-
# Record the given error
|
330
|
+
# Record the given error. It will be passed through the
|
330
331
|
# #ignore_error_filter if there is one.
|
331
332
|
#
|
332
333
|
# * <tt>exception</tt> is the exception which will be recorded. May also be
|
@@ -4,6 +4,7 @@ require 'net/http'
|
|
4
4
|
require 'logger'
|
5
5
|
require 'zlib'
|
6
6
|
require 'stringio'
|
7
|
+
require 'new_relic/data_serialization'
|
7
8
|
|
8
9
|
module NewRelic
|
9
10
|
module Agent
|
@@ -73,6 +74,7 @@ module NewRelic
|
|
73
74
|
end
|
74
75
|
|
75
76
|
def unsent_timeslice_data
|
77
|
+
@unsent_timeslice_data ||= {}
|
76
78
|
@unsent_timeslice_data.keys.length
|
77
79
|
end
|
78
80
|
|
@@ -294,7 +296,7 @@ module NewRelic
|
|
294
296
|
end
|
295
297
|
|
296
298
|
def log_sql_transmission_warning?
|
297
|
-
log_if((@record_sql == :raw), :warn, "Agent is configured to send raw SQL to
|
299
|
+
log_if((@record_sql == :raw), :warn, "Agent is configured to send raw SQL to the service")
|
298
300
|
end
|
299
301
|
|
300
302
|
def sampler_config
|
@@ -352,7 +354,7 @@ module NewRelic
|
|
352
354
|
end
|
353
355
|
|
354
356
|
def log_version_and_pid
|
355
|
-
log.info "New Relic
|
357
|
+
log.info "New Relic Ruby Agent #{NewRelic::VERSION::STRING} Initialized: pid = #{$$}"
|
356
358
|
end
|
357
359
|
|
358
360
|
def log_if(boolean, level, message)
|
@@ -467,7 +469,7 @@ module NewRelic
|
|
467
469
|
# when a disconnect is requested, stop the current thread, which
|
468
470
|
# is the worker thread that gathers data and talks to the
|
469
471
|
# server.
|
470
|
-
log.error "
|
472
|
+
log.error "New Relic forced this agent to disconnect (#{error.message})"
|
471
473
|
disconnect
|
472
474
|
end
|
473
475
|
|
@@ -520,7 +522,7 @@ module NewRelic
|
|
520
522
|
#
|
521
523
|
# See #connect for a description of connection_options.
|
522
524
|
def start_worker_thread(connection_options = {})
|
523
|
-
log.debug "Creating
|
525
|
+
log.debug "Creating Ruby Agent worker thread."
|
524
526
|
@worker_thread = Thread.new do
|
525
527
|
deferred_work!(connection_options)
|
526
528
|
end # thread new
|
@@ -570,7 +572,7 @@ module NewRelic
|
|
570
572
|
end
|
571
573
|
|
572
574
|
def log_error(error)
|
573
|
-
log.error "Error establishing connection with New Relic
|
575
|
+
log.error "Error establishing connection with New Relic Service at #{control.server}: #{error.message}"
|
574
576
|
log.debug error.backtrace.join("\n")
|
575
577
|
end
|
576
578
|
|
@@ -621,7 +623,7 @@ module NewRelic
|
|
621
623
|
else
|
622
624
|
error_collector.enabled = false
|
623
625
|
end
|
624
|
-
log.debug "Errors will #{enabled ? '' : 'not '}be sent to the
|
626
|
+
log.debug "Errors will #{enabled ? '' : 'not '}be sent to the New Relic service."
|
625
627
|
end
|
626
628
|
|
627
629
|
def enable_random_samples!(sample_rate)
|
@@ -642,7 +644,7 @@ module NewRelic
|
|
642
644
|
enable_random_samples!(sample_rate) if @should_send_random_samples
|
643
645
|
log.debug "Transaction tracing threshold is #{@slowest_transaction_threshold} seconds."
|
644
646
|
else
|
645
|
-
log.debug "Transaction traces will not be sent to the
|
647
|
+
log.debug "Transaction traces will not be sent to the New Relic service."
|
646
648
|
end
|
647
649
|
end
|
648
650
|
|
@@ -723,7 +725,7 @@ module NewRelic
|
|
723
725
|
# later (default true).
|
724
726
|
# * <tt>force_reconnect => true</tt> if you want to establish a new connection
|
725
727
|
# to the server before running the worker loop. This means you get a separate
|
726
|
-
# agent run and
|
728
|
+
# agent run and New Relic sees it as a separate instance (default is false).
|
727
729
|
def connect(options)
|
728
730
|
# Don't proceed if we already connected (@connected=true) or if we tried
|
729
731
|
# to connect and were rejected with prejudice because of a license issue
|
@@ -734,7 +736,7 @@ module NewRelic
|
|
734
736
|
@connect_retry_period = should_keep_retrying?(options) ? 10 : 0
|
735
737
|
|
736
738
|
sleep connect_retry_period
|
737
|
-
log.debug "Connecting Process to
|
739
|
+
log.debug "Connecting Process to New Relic: #$0"
|
738
740
|
query_server_for_configuration
|
739
741
|
@connected_pid = $$
|
740
742
|
@connected = true
|
@@ -921,7 +923,7 @@ module NewRelic
|
|
921
923
|
response = http.request(request)
|
922
924
|
end
|
923
925
|
rescue Timeout::Error
|
924
|
-
log.warn "Timed out trying to post data to
|
926
|
+
log.warn "Timed out trying to post data to New Relic (timeout = #{@request_timeout} seconds)" unless @request_timeout < 30
|
925
927
|
raise
|
926
928
|
end
|
927
929
|
if response.is_a? Net::HTTPServiceUnavailable
|
@@ -999,7 +1001,7 @@ module NewRelic
|
|
999
1001
|
log.debug "Serializing agent data to disk"
|
1000
1002
|
NewRelic::Agent.save_data
|
1001
1003
|
if @connected_pid == $$
|
1002
|
-
log.debug "Sending
|
1004
|
+
log.debug "Sending New Relic service agent run shutdown message"
|
1003
1005
|
invoke_remote :shutdown, @agent_id, Time.now.to_f
|
1004
1006
|
else
|
1005
1007
|
log.debug "This agent connected from parent process #{@connected_pid}--not sending shutdown"
|
@@ -2,19 +2,23 @@ module NewRelic
|
|
2
2
|
module Agent
|
3
3
|
class BeaconConfiguration
|
4
4
|
attr_reader :browser_timing_header
|
5
|
+
attr_reader :browser_timing_static_footer
|
5
6
|
attr_reader :application_id
|
6
7
|
attr_reader :browser_monitoring_key
|
7
8
|
attr_reader :beacon
|
8
9
|
attr_reader :rum_enabled
|
9
10
|
attr_reader :license_bytes
|
10
11
|
|
12
|
+
JS_HEADER = "<script>var NREUMQ=[];NREUMQ.push([\"mark\",\"firstbyte\",new Date().getTime()]);</script>"
|
13
|
+
|
11
14
|
def initialize(connect_data)
|
12
15
|
@browser_monitoring_key = connect_data['browser_key']
|
13
16
|
@application_id = connect_data['application_id']
|
14
17
|
@beacon = connect_data['beacon']
|
15
18
|
@rum_enabled = connect_data['rum.enabled']
|
16
19
|
@rum_enabled = true if @rum_enabled.nil?
|
17
|
-
@browser_timing_header = build_browser_timing_header
|
20
|
+
@browser_timing_header = build_browser_timing_header
|
21
|
+
@browser_timing_static_footer = build_load_file_js(connect_data)
|
18
22
|
end
|
19
23
|
|
20
24
|
def license_bytes
|
@@ -25,22 +29,22 @@ module NewRelic
|
|
25
29
|
@license_bytes
|
26
30
|
end
|
27
31
|
|
28
|
-
def
|
32
|
+
def build_load_file_js(connect_data)
|
29
33
|
return "" unless connect_data.fetch('rum.load_episodes_file', true)
|
30
34
|
|
31
35
|
episodes_url = connect_data.fetch('episodes_url', '')
|
32
|
-
"(function(){var d=document;var e=d.createElement(\"script\");e.
|
36
|
+
"(function(){var d=document;var e=d.createElement(\"script\");e.async=true;e.src=\"#{episodes_url}\";var s=d.getElementsByTagName(\"script\")[0];s.parentNode.insertBefore(e,s);})();"
|
33
37
|
end
|
34
38
|
|
35
|
-
def
|
36
|
-
|
39
|
+
def javascript_header
|
40
|
+
JS_HEADER.dup
|
37
41
|
end
|
38
42
|
|
39
|
-
def build_browser_timing_header
|
43
|
+
def build_browser_timing_header
|
40
44
|
return "" if !@rum_enabled
|
41
45
|
return "" if @browser_monitoring_key.nil?
|
42
|
-
|
43
|
-
value =
|
46
|
+
|
47
|
+
value = javascript_header
|
44
48
|
if value.respond_to?(:html_safe)
|
45
49
|
value.html_safe
|
46
50
|
else
|
@@ -56,7 +56,7 @@ module NewRelic
|
|
56
56
|
|
57
57
|
def footer_js_string(beacon, license_key, application_id)
|
58
58
|
obfuscated_transaction_name = obfuscate(browser_monitoring_transaction_name)
|
59
|
-
html_safe_if_needed("<script
|
59
|
+
html_safe_if_needed("<script>#{NewRelic::Agent.instance.beacon_configuration.browser_timing_static_footer}NREUMQ.push([\"nrf2\",\"#{beacon}\",\"#{license_key}\",#{application_id},\"#{obfuscated_transaction_name}\",#{browser_monitoring_queue_time},#{browser_monitoring_app_time},new Date().getTime()])</script>")
|
60
60
|
end
|
61
61
|
|
62
62
|
def html_safe_if_needed(string)
|
@@ -76,7 +76,7 @@ module NewRelic
|
|
76
76
|
index+=1
|
77
77
|
}
|
78
78
|
|
79
|
-
[obfuscated].pack("m0").
|
79
|
+
[obfuscated].pack("m0").gsub("\n", '')
|
80
80
|
end
|
81
81
|
end
|
82
82
|
end
|
@@ -145,7 +145,7 @@ module NewRelic
|
|
145
145
|
|
146
146
|
def over_queue_limit?(message)
|
147
147
|
over_limit = (@errors.length >= MAX_ERROR_QUEUE_LENGTH)
|
148
|
-
log.warn("The error reporting queue has reached #{MAX_ERROR_QUEUE_LENGTH}. The error detail for this and subsequent errors will not be transmitted to
|
148
|
+
log.warn("The error reporting queue has reached #{MAX_ERROR_QUEUE_LENGTH}. The error detail for this and subsequent errors will not be transmitted to New Relic until the queued errors have been sent: #{message}") if over_limit
|
149
149
|
over_limit
|
150
150
|
end
|
151
151
|
|