newrelic_rpm 3.17.1.326 → 3.17.2.327
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +10 -21
- data/{CHANGELOG → CHANGELOG.md} +143 -93
- data/lib/new_relic/agent/configuration/default_source.rb +31 -19
- data/lib/new_relic/agent/configuration/environment_source.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_record_4.rb +2 -2
- data/lib/new_relic/agent/instrumentation/active_record_5.rb +89 -0
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +3 -3
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +2 -2
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +2 -0
- data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +8 -6
- data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +3 -2
- data/lib/new_relic/agent/instrumentation/rails5/action_controller.rb +12 -3
- data/lib/new_relic/agent/instrumentation/redis.rb +2 -1
- data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +1 -1
- data/lib/new_relic/agent/new_relic_service.rb +6 -2
- data/lib/new_relic/agent/transaction/datastore_segment.rb +31 -7
- data/lib/new_relic/agent/transaction/tracing.rb +6 -1
- data/lib/new_relic/latest_changes.rb +1 -1
- data/lib/new_relic/version.rb +3 -3
- data/newrelic_rpm.gemspec +2 -1
- data/test/environments/rails21/Gemfile +1 -1
- data/test/environments/rails22/Gemfile +2 -1
- data/test/environments/rails23/Gemfile +6 -1
- data/test/fixtures/cross_agent_tests/datastores/README.md +1 -1
- data/test/fixtures/cross_agent_tests/datastores/datastore_api.json +443 -0
- data/test/fixtures/cross_agent_tests/datastores/datastore_instances.json +0 -47
- data/test/multiverse/lib/multiverse/runner.rb +2 -1
- data/test/multiverse/suites/memcached/dalli_test.rb +5 -12
- data/test/multiverse/suites/resque/instrumentation_test.rb +4 -0
- data/test/multiverse/suites/sidekiq/sidekiq_server.rb +5 -1
- data/test/multiverse/suites/sinatra/Envfile +8 -0
- data/test/multiverse/suites/sinatra/sinatra_error_tracing_test.rb +1 -1
- data/test/multiverse/suites/sinatra/sinatra_test_cases.rb +27 -9
- data/test/multiverse/suites/typhoeus/Envfile +5 -0
- data/test/new_relic/agent/api_tests/datastore_api_test.rb +64 -0
- data/test/new_relic/agent/configuration/default_source_test.rb +6 -3
- data/test/new_relic/agent/instrumentation/active_record_subscriber_test.rb +27 -1
- data/test/new_relic/agent/instrumentation/instance_identification_test.rb +4 -22
- data/test/new_relic/agent/instrumentation/mongodb_command_subscriber_test.rb +7 -0
- data/test/new_relic/agent/new_relic_service_test.rb +10 -2
- data/test/new_relic/agent/transaction/datastore_segment_test.rb +96 -6
- data/test/new_relic/agent/transaction/tracing_test.rb +9 -0
- data/test/new_relic/agent_test.rb +2 -1
- data/test/new_relic/latest_changes_test.rb +1 -1
- data/test/new_relic/rack/error_collector_test.rb +4 -0
- data/test/script/before_install/gemstash_mirror.sh +10 -0
- data/test/script/before_install/jruby_bundler.sh +22 -0
- data/test/script/before_install/revert_rubygems.sh +15 -0
- data/test/script/before_script/install_mongodb.sh +12 -0
- metadata +11 -5
- data/test/script/install_mongodb.sh +0 -6
@@ -15,7 +15,11 @@ module NewRelic
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
class Boolean
|
18
|
+
class Boolean
|
19
|
+
def self.===(o)
|
20
|
+
TrueClass === o or FalseClass === o
|
21
|
+
end
|
22
|
+
end
|
19
23
|
|
20
24
|
class DefaultSource
|
21
25
|
attr_reader :defaults
|
@@ -329,7 +333,7 @@ module NewRelic
|
|
329
333
|
:default => 8080,
|
330
334
|
:allow_nil => true,
|
331
335
|
:public => true,
|
332
|
-
:type =>
|
336
|
+
:type => Integer,
|
333
337
|
:allowed_from_server => false,
|
334
338
|
:description => 'Defines a port for communicating with the New Relic <a href="https://docs.newrelic.com/docs/apm/new-relic-apm/getting-started/glossary#collector">collector</a> via a proxy server.'
|
335
339
|
},
|
@@ -432,7 +436,7 @@ module NewRelic
|
|
432
436
|
:'rake.connect_timeout' => {
|
433
437
|
:default => 10,
|
434
438
|
:public => true,
|
435
|
-
:type =>
|
439
|
+
:type => Integer,
|
436
440
|
:allowed_from_server => false,
|
437
441
|
:description => 'Timeout for waiting on connect to complete before a rake task'
|
438
442
|
},
|
@@ -483,14 +487,14 @@ module NewRelic
|
|
483
487
|
:port => {
|
484
488
|
:default => DefaultSource.port,
|
485
489
|
:public => false,
|
486
|
-
:type =>
|
490
|
+
:type => Integer,
|
487
491
|
:allowed_from_server => false,
|
488
492
|
:description => 'Port for the New Relic data collection service.'
|
489
493
|
},
|
490
494
|
:api_port => {
|
491
495
|
:default => value_of(:port),
|
492
496
|
:public => false,
|
493
|
-
:type =>
|
497
|
+
:type => Integer,
|
494
498
|
:allowed_from_server => false,
|
495
499
|
:description => 'Port for the New Relic API host.'
|
496
500
|
},
|
@@ -511,7 +515,7 @@ module NewRelic
|
|
511
515
|
:post_size_limit => {
|
512
516
|
:default => 2 * 1024 * 1024, # 2MB
|
513
517
|
:public => false,
|
514
|
-
:type =>
|
518
|
+
:type => Integer,
|
515
519
|
:allowed_from_server => true,
|
516
520
|
:description => 'Maximum number of bytes to send to the New Relic data collection service.'
|
517
521
|
},
|
@@ -539,7 +543,7 @@ module NewRelic
|
|
539
543
|
:timeout => {
|
540
544
|
:default => 2 * 60, # 2 minutes
|
541
545
|
:public => true,
|
542
|
-
:type =>
|
546
|
+
:type => Integer,
|
543
547
|
:allowed_from_server => false,
|
544
548
|
:description => 'Defines the maximum number of seconds the agent should spend attempting to connect to the collector.'
|
545
549
|
},
|
@@ -553,14 +557,14 @@ module NewRelic
|
|
553
557
|
:data_report_period => {
|
554
558
|
:default => 60,
|
555
559
|
:public => false,
|
556
|
-
:type =>
|
560
|
+
:type => Integer,
|
557
561
|
:allowed_from_server => true,
|
558
562
|
:description => 'Number of seconds betwixt connections to the New Relic data collection service. Note that transaction events have a separate report period, specified by data_report_periods.analytic_event_data.'
|
559
563
|
},
|
560
564
|
:'data_report_periods.analytic_event_data' => {
|
561
565
|
:default => 60,
|
562
566
|
:public => false,
|
563
|
-
:type =>
|
567
|
+
:type => Integer,
|
564
568
|
:dynamic_name => true,
|
565
569
|
:allowed_from_server => true,
|
566
570
|
:description => 'Number of seconds between connections to the New Relic data collection service for sending transaction event data.'
|
@@ -857,7 +861,7 @@ module NewRelic
|
|
857
861
|
:'transaction_tracer.limit_segments' => {
|
858
862
|
:default => 4000,
|
859
863
|
:public => true,
|
860
|
-
:type =>
|
864
|
+
:type => Integer,
|
861
865
|
:allowed_from_server => true,
|
862
866
|
:description => 'Maximum number of transaction trace nodes to record in a single transaction trace.'
|
863
867
|
},
|
@@ -979,7 +983,7 @@ module NewRelic
|
|
979
983
|
:'error_collector.max_event_samples_stored' => {
|
980
984
|
:default => 100,
|
981
985
|
:public => true,
|
982
|
-
:type =>
|
986
|
+
:type => Integer,
|
983
987
|
:allowed_from_server => true,
|
984
988
|
:description => 'Defines the maximum number of <a href="https://docs.newrelic.com/docs/insights/new-relic-insights/decorating-events/error-event-default-attributes-insights">TransactionError events</a> sent to Insights per harvest cycle.'
|
985
989
|
},
|
@@ -1152,7 +1156,7 @@ module NewRelic
|
|
1152
1156
|
:'xray_session.max_samples' => {
|
1153
1157
|
:default => 10,
|
1154
1158
|
:public => false,
|
1155
|
-
:type =>
|
1159
|
+
:type => Integer,
|
1156
1160
|
:allowed_from_server => true,
|
1157
1161
|
:description => 'Maximum number of transaction traces to buffer for active X-Ray sessions'
|
1158
1162
|
},
|
@@ -1180,7 +1184,7 @@ module NewRelic
|
|
1180
1184
|
:'analytics_events.max_samples_stored' => {
|
1181
1185
|
:default => 1200,
|
1182
1186
|
:public => true,
|
1183
|
-
:type =>
|
1187
|
+
:type => Integer,
|
1184
1188
|
:allowed_from_server => true,
|
1185
1189
|
:description => 'Defines the maximum number of request events reported from a single harvest.'
|
1186
1190
|
},
|
@@ -1246,6 +1250,14 @@ module NewRelic
|
|
1246
1250
|
:allowed_from_server => false,
|
1247
1251
|
:description => 'If <code>true</code>, disables instrumentation for ActiveRecord 4.'
|
1248
1252
|
},
|
1253
|
+
:disable_active_record_5 => {
|
1254
|
+
:default => false,
|
1255
|
+
:public => true,
|
1256
|
+
:type => Boolean,
|
1257
|
+
:dynamic_name => true,
|
1258
|
+
:allowed_from_server => false,
|
1259
|
+
:description => 'If <code>true</code>, disables instrumentation for ActiveRecord 5.'
|
1260
|
+
},
|
1249
1261
|
:disable_curb => {
|
1250
1262
|
:default => false,
|
1251
1263
|
:public => true,
|
@@ -1387,7 +1399,7 @@ module NewRelic
|
|
1387
1399
|
:keep_alive_timeout => {
|
1388
1400
|
:default => 60,
|
1389
1401
|
:public => false,
|
1390
|
-
:type =>
|
1402
|
+
:type => Integer,
|
1391
1403
|
:allowed_from_server => true,
|
1392
1404
|
:description => 'Timeout for keep alive on TCP connection to collector if supported by Ruby version. Only used in conjunction when aggressive_keepalive is enabled.'
|
1393
1405
|
},
|
@@ -1410,14 +1422,14 @@ module NewRelic
|
|
1410
1422
|
:'synthetics.traces_limit' => {
|
1411
1423
|
:default => 20,
|
1412
1424
|
:public => false,
|
1413
|
-
:type =>
|
1425
|
+
:type => Integer,
|
1414
1426
|
:allowed_from_server => true,
|
1415
1427
|
:description => 'Maximum number of synthetics transaction traces to hold for a given harvest'
|
1416
1428
|
},
|
1417
1429
|
:'synthetics.events_limit' => {
|
1418
1430
|
:default => 200,
|
1419
1431
|
:public => false,
|
1420
|
-
:type =>
|
1432
|
+
:type => Integer,
|
1421
1433
|
:allowed_from_server => true,
|
1422
1434
|
:description => 'Maximum number of synthetics transaction events to hold for a given harvest'
|
1423
1435
|
},
|
@@ -1431,7 +1443,7 @@ module NewRelic
|
|
1431
1443
|
:'custom_insights_events.max_samples_stored' => {
|
1432
1444
|
:default => 1000,
|
1433
1445
|
:public => true,
|
1434
|
-
:type =>
|
1446
|
+
:type => Integer,
|
1435
1447
|
:allowed_from_server => true,
|
1436
1448
|
:description => 'Specify a maximum number of custom Insights events to buffer in memory at a time.',
|
1437
1449
|
:dynamic_name => true
|
@@ -1591,7 +1603,7 @@ module NewRelic
|
|
1591
1603
|
:default => nil,
|
1592
1604
|
:allow_nil => true,
|
1593
1605
|
:public => false,
|
1594
|
-
:type =>
|
1606
|
+
:type => Integer,
|
1595
1607
|
:allowed_from_server => false,
|
1596
1608
|
:description => 'The total number of hyper-threaded execution contexts available.'
|
1597
1609
|
},
|
@@ -1599,7 +1611,7 @@ module NewRelic
|
|
1599
1611
|
:default => nil,
|
1600
1612
|
:allow_nil => true,
|
1601
1613
|
:public => false,
|
1602
|
-
:type =>
|
1614
|
+
:type => Integer,
|
1603
1615
|
:allowed_from_server => false,
|
1604
1616
|
:description => 'This value represents the total amount of memory available to the host (not the process), in mebibytes (1024 squared or 1,048,576 bytes).'
|
1605
1617
|
},
|
@@ -9,7 +9,7 @@ DependencyDetection.defer do
|
|
9
9
|
depends_on do
|
10
10
|
defined?(::ActiveRecord) && defined?(::ActiveRecord::Base) &&
|
11
11
|
defined?(::ActiveRecord::VERSION) &&
|
12
|
-
::ActiveRecord::VERSION::MAJOR.to_i
|
12
|
+
::ActiveRecord::VERSION::MAJOR.to_i == 4
|
13
13
|
end
|
14
14
|
|
15
15
|
depends_on do
|
@@ -18,7 +18,7 @@ DependencyDetection.defer do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
executes do
|
21
|
-
::NewRelic::Agent.logger.info 'Installing ActiveRecord 4
|
21
|
+
::NewRelic::Agent.logger.info 'Installing ActiveRecord 4 instrumentation'
|
22
22
|
end
|
23
23
|
|
24
24
|
executes do
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# This file is distributed under New Relic's license terms.
|
3
|
+
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
|
4
|
+
require 'new_relic/agent/instrumentation/active_record_subscriber'
|
5
|
+
|
6
|
+
module NewRelic
|
7
|
+
module Agent
|
8
|
+
module Instrumentation
|
9
|
+
module ActiveRecord
|
10
|
+
ACTIVE_RECORD = "ActiveRecord".freeze
|
11
|
+
|
12
|
+
module BaseExtensions
|
13
|
+
def save(*args, &blk)
|
14
|
+
::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
|
15
|
+
super
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def save!(*args, &blk)
|
20
|
+
::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
|
21
|
+
super
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
module RelationExtensions
|
27
|
+
def update_all(*args, &blk)
|
28
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
29
|
+
super
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def delete_all(*args, &blk)
|
34
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
35
|
+
super
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def destroy_all(*args, &blk)
|
40
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
41
|
+
super
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def calculate(*args, &blk)
|
46
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
47
|
+
super
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def pluck(*args, &blk)
|
52
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
53
|
+
super
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
DependencyDetection.defer do
|
63
|
+
named :active_record_5
|
64
|
+
|
65
|
+
depends_on do
|
66
|
+
defined?(::ActiveRecord) && defined?(::ActiveRecord::Base) &&
|
67
|
+
defined?(::ActiveRecord::VERSION) &&
|
68
|
+
::ActiveRecord::VERSION::MAJOR.to_i == 5
|
69
|
+
end
|
70
|
+
|
71
|
+
depends_on do
|
72
|
+
!NewRelic::Agent.config[:disable_activerecord_instrumentation] &&
|
73
|
+
!NewRelic::Agent::Instrumentation::ActiveRecordSubscriber.subscribed?
|
74
|
+
end
|
75
|
+
|
76
|
+
executes do
|
77
|
+
::NewRelic::Agent.logger.info 'Installing ActiveRecord 5 instrumentation'
|
78
|
+
end
|
79
|
+
|
80
|
+
executes do
|
81
|
+
ActiveSupport::Notifications.subscribe('sql.active_record',
|
82
|
+
NewRelic::Agent::Instrumentation::ActiveRecordSubscriber.new)
|
83
|
+
|
84
|
+
ActiveSupport.on_load(:active_record) do
|
85
|
+
::ActiveRecord::Base.prepend ::NewRelic::Agent::Instrumentation::ActiveRecord::BaseExtensions
|
86
|
+
::ActiveRecord::Relation.prepend ::NewRelic::Agent::Instrumentation::ActiveRecord::RelationExtensions
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -224,6 +224,7 @@ module NewRelic
|
|
224
224
|
DEFAULT = "default".freeze unless defined?(DEFAULT)
|
225
225
|
UNKNOWN = "unknown".freeze unless defined?(UNKNOWN)
|
226
226
|
SLASH = "/".freeze unless defined?(SLASH)
|
227
|
+
LOCALHOST = "localhost".freeze unless defined?(LOCALHOST)
|
227
228
|
|
228
229
|
def host(config)
|
229
230
|
return UNKNOWN unless config
|
@@ -231,10 +232,9 @@ module NewRelic
|
|
231
232
|
configured_value = config[:host]
|
232
233
|
adapter = PRODUCT_SYMBOLS[config[:adapter]]
|
233
234
|
if configured_value.nil? ||
|
234
|
-
Hostname.local?(configured_value) ||
|
235
235
|
postgres_unix_domain_socket_case?(configured_value, adapter)
|
236
236
|
|
237
|
-
|
237
|
+
LOCALHOST
|
238
238
|
elsif configured_value.empty?
|
239
239
|
UNKNOWN
|
240
240
|
else
|
@@ -256,7 +256,7 @@ module NewRelic
|
|
256
256
|
DEFAULT
|
257
257
|
elsif config[:port].nil?
|
258
258
|
DATASTORE_DEFAULT_PORTS[adapter] || DEFAULT
|
259
|
-
elsif config[:port].is_a?(
|
259
|
+
elsif config[:port].is_a?(Integer) || config[:port].to_i != 0
|
260
260
|
config[:port].to_s
|
261
261
|
else
|
262
262
|
UNKNOWN
|
@@ -384,7 +384,7 @@ module NewRelic
|
|
384
384
|
opts[:request]
|
385
385
|
# in a Rails app
|
386
386
|
elsif self.respond_to?(:request)
|
387
|
-
self.request
|
387
|
+
self.request rescue nil
|
388
388
|
end
|
389
389
|
end
|
390
390
|
|
@@ -426,7 +426,7 @@ module NewRelic
|
|
426
426
|
def create_transaction_options(trace_options, category, state)
|
427
427
|
txn_options = {}
|
428
428
|
txn_options[:request] = trace_options[:request]
|
429
|
-
txn_options[:request] ||= request if respond_to?(:request)
|
429
|
+
txn_options[:request] ||= request if respond_to?(:request) rescue nil
|
430
430
|
# params should have been filtered before calling perform_action_with_newrelic_trace
|
431
431
|
txn_options[:filtered_params] = trace_options[:params]
|
432
432
|
txn_options[:transaction_name] = TransactionNamer.name_for(nil, self, category, trace_options)
|
@@ -137,6 +137,8 @@ module NewRelic
|
|
137
137
|
|
138
138
|
begin
|
139
139
|
self.send("#{method_name}_without_newrelic", *args, &blk)
|
140
|
+
rescue ::DataObjects::ConnectionError => e
|
141
|
+
raise
|
140
142
|
rescue ::DataObjects::SQLError => e
|
141
143
|
e.uri.gsub!(PASSWORD_REGEX, AMPERSAND) if e.uri.include?(PASSWORD_PARAM)
|
142
144
|
|
@@ -15,6 +15,7 @@ module NewRelic
|
|
15
15
|
DATASTORE_INSTANCES_SUPPORTED_VERSION = ::NewRelic::VersionNumber.new '2.6.4'
|
16
16
|
SLASH = '/'.freeze
|
17
17
|
UNKNOWN = 'unknown'.freeze
|
18
|
+
LOCALHOST = 'localhost'.freeze
|
18
19
|
|
19
20
|
def supports_datastore_instances?
|
20
21
|
DATASTORE_INSTANCES_SUPPORTED_VERSION <= ::Dalli::VERSION
|
@@ -95,17 +96,18 @@ module NewRelic
|
|
95
96
|
end
|
96
97
|
|
97
98
|
def assign_instance_to segment, server
|
99
|
+
host = port_path_or_id = nil
|
98
100
|
if server.hostname.start_with? SLASH
|
99
|
-
|
100
|
-
|
101
|
+
host = LOCALHOST
|
102
|
+
port_path_or_id = server.hostname
|
101
103
|
else
|
102
|
-
|
103
|
-
|
104
|
+
host = server.hostname
|
105
|
+
port_path_or_id = server.port
|
104
106
|
end
|
107
|
+
segment.set_instance_info host, port_path_or_id
|
105
108
|
rescue => e
|
106
109
|
::NewRelic::Agent.logger.debug "Failed to retrieve memcached instance info: #{e.message}"
|
107
|
-
segment.
|
108
|
-
segment.port_path_or_id = UNKNOWN
|
110
|
+
segment.set_instance_info UNKNOWN, UNKNOWN
|
109
111
|
end
|
110
112
|
|
111
113
|
end
|
@@ -67,12 +67,13 @@ module NewRelic
|
|
67
67
|
end
|
68
68
|
|
69
69
|
UNKNOWN = "unknown".freeze
|
70
|
+
LOCALHOST = "localhost".freeze
|
70
71
|
|
71
72
|
def host_from_address(address)
|
72
73
|
if unix_domain_socket? address.host
|
73
|
-
|
74
|
+
LOCALHOST
|
74
75
|
else
|
75
|
-
|
76
|
+
address.host
|
76
77
|
end
|
77
78
|
rescue => e
|
78
79
|
NewRelic::Agent.logger.debug "Failed to retrieve Mongo host: #{e}"
|
@@ -12,7 +12,7 @@ DependencyDetection.defer do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
depends_on do
|
15
|
-
defined?(ActionController) && defined?(ActionController::Base)
|
15
|
+
defined?(ActionController) && (defined?(ActionController::Base) || defined?(ActionController::API))
|
16
16
|
end
|
17
17
|
|
18
18
|
executes do
|
@@ -20,9 +20,18 @@ DependencyDetection.defer do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
executes do
|
23
|
-
|
24
|
-
|
23
|
+
if defined?(ActionController::Base)
|
24
|
+
class ActionController::Base
|
25
|
+
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
26
|
+
end
|
25
27
|
end
|
28
|
+
|
29
|
+
if defined?(ActionController::API)
|
30
|
+
class ActionController::API
|
31
|
+
include NewRelic::Agent::Instrumentation::ControllerInstrumentation
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
26
35
|
NewRelic::Agent::Instrumentation::ActionControllerSubscriber \
|
27
36
|
.subscribe(/^process_action.action_controller$/)
|
28
37
|
end
|
@@ -12,9 +12,10 @@ module NewRelic
|
|
12
12
|
extend self
|
13
13
|
|
14
14
|
UNKNOWN = "unknown".freeze
|
15
|
+
LOCALHOST = "localhost".freeze
|
15
16
|
|
16
17
|
def host_for(client)
|
17
|
-
client.path ?
|
18
|
+
client.path ? LOCALHOST : client.host
|
18
19
|
rescue => e
|
19
20
|
NewRelic::Agent.logger.debug "Failed to retrieve Redis host: #{e}"
|
20
21
|
UNKNOWN
|