newrelic_rpm 4.6.0.338 → 4.7.0.339
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +61 -0
- data/lib/new_relic/agent/configuration/default_source.rb +7 -0
- data/lib/new_relic/agent/datastores.rb +9 -2
- data/lib/new_relic/agent/error_collector.rb +4 -2
- data/lib/new_relic/agent/external.rb +5 -1
- data/lib/new_relic/agent/http_clients/excon_wrappers.rb +3 -1
- data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +4 -2
- data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +1 -1
- data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +1 -1
- data/lib/new_relic/agent/instrumentation/active_record.rb +17 -3
- data/lib/new_relic/agent/instrumentation/active_record_4.rb +9 -1
- data/lib/new_relic/agent/instrumentation/active_record_5.rb +5 -61
- data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +61 -0
- data/lib/new_relic/agent/instrumentation/bunny.rb +3 -1
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -0
- data/lib/new_relic/agent/instrumentation/curb.rb +4 -1
- data/lib/new_relic/agent/instrumentation/data_mapper.rb +5 -1
- data/lib/new_relic/agent/instrumentation/excon/connection.rb +4 -1
- data/lib/new_relic/agent/instrumentation/excon/middleware.rb +4 -1
- data/lib/new_relic/agent/instrumentation/http.rb +4 -1
- data/lib/new_relic/agent/instrumentation/httpclient.rb +4 -1
- data/lib/new_relic/agent/instrumentation/memcache.rb +4 -1
- data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +5 -2
- data/lib/new_relic/agent/instrumentation/mongo.rb +6 -1
- data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +6 -1
- data/lib/new_relic/agent/instrumentation/net.rb +4 -1
- data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +5 -3
- data/lib/new_relic/agent/instrumentation/rails4/action_controller.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails4/action_view.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails5/action_cable.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails5/action_controller.rb +5 -5
- data/lib/new_relic/agent/instrumentation/rails5/action_view.rb +1 -1
- data/lib/new_relic/agent/instrumentation/rails_middleware.rb +1 -1
- data/lib/new_relic/agent/instrumentation/redis.rb +21 -6
- data/lib/new_relic/agent/instrumentation/typhoeus.rb +48 -24
- data/lib/new_relic/agent/javascript_instrumentor.rb +2 -2
- data/lib/new_relic/agent/messaging.rb +7 -5
- data/lib/new_relic/agent/method_tracer_helpers.rb +5 -1
- data/lib/new_relic/agent/range_extensions.rb +47 -0
- data/lib/new_relic/agent/transaction.rb +8 -2
- data/lib/new_relic/agent/transaction/abstract_segment.rb +134 -25
- data/lib/new_relic/agent/transaction/datastore_segment.rb +5 -2
- data/lib/new_relic/agent/transaction/external_request_segment.rb +3 -2
- data/lib/new_relic/agent/transaction/segment.rb +0 -3
- data/lib/new_relic/agent/transaction/tracing.rb +77 -20
- data/lib/new_relic/agent/transaction_error_primitive.rb +2 -0
- data/lib/new_relic/noticed_error.rb +9 -6
- data/lib/new_relic/version.rb +1 -1
- data/lib/sequel/extensions/newrelic_instrumentation.rb +4 -1
- data/lib/sequel/plugins/newrelic_instrumentation.rb +5 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aabe09622c53b4daace84facb8f8ada18fc60744
|
4
|
+
data.tar.gz: 743c735df3aec5ee4dc31a861039835143e45fd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc9a023f05c6fc816622fad43aa920619c7acf14c49dbfbe5ec9513056f11da6a6ab56d343cfcc2f73ed484e156bc3ca535a7162530197228200b0d102503d5a
|
7
|
+
data.tar.gz: 7added760ccb67756285381503e6d4e7e6411bf61e2a6c0814a22465beda1516d8ddce1d2c5de8403b27b3413211ccf20c4f43ae287389dc179500d60a919490
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,66 @@
|
|
1
1
|
# New Relic Ruby Agent Release Notes #
|
2
2
|
|
3
|
+
## v4.7.0 ##
|
4
|
+
|
5
|
+
* Expected Error API
|
6
|
+
|
7
|
+
The agent now sends up `error.expected` as an intrinsic attribute on error
|
8
|
+
events and error traces. When you pass `expected: true` to the `notice_error`
|
9
|
+
method, both Insights and APM will indicate that the error is expected.
|
10
|
+
|
11
|
+
* Typhoeus Hydra Instrumentation
|
12
|
+
|
13
|
+
The agent now has request level visibility for HTTP requests made using
|
14
|
+
Typhoeus Hydra.
|
15
|
+
|
16
|
+
* Total Time Metrics are Recorded
|
17
|
+
|
18
|
+
The agent now records Total Time metrics. In an application where segments
|
19
|
+
execute concurrently, the total time can exceed the wall-clock time for a
|
20
|
+
transaction. Users of the new Typhoeus Hydra instrumentation will notice
|
21
|
+
this as changes on the overview page. Immediately after upgrading there
|
22
|
+
will be an alert in the APM dashboard that states: "There are both old and
|
23
|
+
new time metrics for this time window". This indicates that during that time
|
24
|
+
window, some transactions report the total time metrics, while others do not.
|
25
|
+
The message will go away after waiting for enough time to elapse and / or
|
26
|
+
updating the time window.
|
27
|
+
|
28
|
+
* Add `:message` category to `set_transaction_name` public API method
|
29
|
+
|
30
|
+
The agent now permits the `:message` category to be passed into the public
|
31
|
+
API method `set_transaction_name`, which will enable the transaction to be
|
32
|
+
displayed as a messaging transaction.
|
33
|
+
|
34
|
+
* Create `prepend_active_record_instrumentation` config option
|
35
|
+
|
36
|
+
Users may now set the `prepend_active_record_instrumentation` option in
|
37
|
+
their agent config to install Active Record 3 or 4 instrumentation using
|
38
|
+
`Module.prepend` rather than `alias_method`.
|
39
|
+
|
40
|
+
* Use Lazy load hooks for `ActionController::Base` and `ActionController::API`
|
41
|
+
|
42
|
+
The agent now uses lazy load hooks to hook on `ActionController::Base` and
|
43
|
+
`ActionController::API`. Thanks Edouard Chin for the contribution!
|
44
|
+
|
45
|
+
* Use Lazy load hooks for `ActiveRecord::Base` and `ActiveRecord::Relation`
|
46
|
+
|
47
|
+
The agent uses lazy load hooks when recording supportability metrics
|
48
|
+
for `ActiveRecord::Base` and `ActiveRecord::Relation`. Thanks Joseph Haig
|
49
|
+
for the contribution!
|
50
|
+
|
51
|
+
* Check that `Rails::VERSION` is defined instead of just `Rails`
|
52
|
+
|
53
|
+
The agent now checks that `Rails::VERSION` is defined since there are cases
|
54
|
+
where `Rails` is defined but `Rails::VERSION` is not. Thanks to Alex Riedler
|
55
|
+
and nilsding for the contribution!
|
56
|
+
|
57
|
+
* Support fast RPC/direct reply-to in RabbitMQ
|
58
|
+
|
59
|
+
The agent can now handle the pseudo-queue 'amq.rabbitmq.reply-to' in its
|
60
|
+
Bunny instrumentation. Previously, using fast RPC led to a `NoMethodError`
|
61
|
+
because the reply-to queue was expected to be a `Queue` object instead of
|
62
|
+
a string.
|
63
|
+
|
3
64
|
## v4.6.0 ##
|
4
65
|
|
5
66
|
* Public API for External Requests
|
@@ -676,6 +676,13 @@ module NewRelic
|
|
676
676
|
:allowed_from_server => false,
|
677
677
|
:description => 'If <code>true</code>, disables active record instrumentation.'
|
678
678
|
},
|
679
|
+
:prepend_active_record_instrumentation => {
|
680
|
+
:default => false,
|
681
|
+
:public => true,
|
682
|
+
:type => Boolean,
|
683
|
+
:allowed_from_server => false,
|
684
|
+
:description => 'If <code>true</code>, uses Module.prepend rather than alias_method for ActiveRecord instrumentation.'
|
685
|
+
},
|
679
686
|
:disable_data_mapper => {
|
680
687
|
:default => false,
|
681
688
|
:public => true,
|
@@ -47,7 +47,10 @@ module NewRelic
|
|
47
47
|
alias_method method_name_without_newrelic, method_name
|
48
48
|
|
49
49
|
define_method(method_name) do |*args, &blk|
|
50
|
-
segment = NewRelic::Agent::Transaction.start_datastore_segment(
|
50
|
+
segment = NewRelic::Agent::Transaction.start_datastore_segment(
|
51
|
+
product: product,
|
52
|
+
operation: operation
|
53
|
+
)
|
51
54
|
begin
|
52
55
|
send(method_name_without_newrelic, *args, &blk)
|
53
56
|
ensure
|
@@ -109,7 +112,11 @@ module NewRelic
|
|
109
112
|
|
110
113
|
return yield unless operation
|
111
114
|
|
112
|
-
segment = NewRelic::Agent::Transaction.start_datastore_segment(
|
115
|
+
segment = NewRelic::Agent::Transaction.start_datastore_segment(
|
116
|
+
product: product,
|
117
|
+
operation: operation,
|
118
|
+
collection: collection
|
119
|
+
)
|
113
120
|
|
114
121
|
begin
|
115
122
|
result = yield
|
@@ -183,7 +183,7 @@ module NewRelic
|
|
183
183
|
|
184
184
|
# extracts a stack trace from the exception for debugging purposes
|
185
185
|
def extract_stack_trace(exception)
|
186
|
-
actual_exception = if defined?(Rails) && Rails::VERSION::MAJOR < 5
|
186
|
+
actual_exception = if defined?(Rails::VERSION::MAJOR) && Rails::VERSION::MAJOR < 5
|
187
187
|
sense_method(exception, :original_exception) || exception
|
188
188
|
else
|
189
189
|
exception
|
@@ -199,7 +199,7 @@ module NewRelic
|
|
199
199
|
|
200
200
|
state = ::NewRelic::Agent::TransactionState.tl_get
|
201
201
|
|
202
|
-
unless options
|
202
|
+
unless options[:expected]
|
203
203
|
increment_error_count!(state, exception, options)
|
204
204
|
end
|
205
205
|
|
@@ -227,6 +227,8 @@ module NewRelic
|
|
227
227
|
noticed_error.line_number = sense_method(exception, :line_number)
|
228
228
|
noticed_error.stack_trace = extract_stack_trace(exception)
|
229
229
|
|
230
|
+
noticed_error.expected = !! options.delete(:expected)
|
231
|
+
|
230
232
|
noticed_error.attributes_from_notice_error = options.delete(:custom_params) || {}
|
231
233
|
|
232
234
|
# Any options that are passed to notice_error which aren't known keys
|
@@ -32,7 +32,11 @@ module NewRelic
|
|
32
32
|
|
33
33
|
::NewRelic::Agent.record_api_supportability_metric(:start_segment)
|
34
34
|
|
35
|
-
::NewRelic::Agent::Transaction.start_external_request_segment(
|
35
|
+
::NewRelic::Agent::Transaction.start_external_request_segment(
|
36
|
+
library: library,
|
37
|
+
uri: uri,
|
38
|
+
procedure: procedure
|
39
|
+
)
|
36
40
|
end
|
37
41
|
|
38
42
|
NON_HTTP_CAT_ID_HEADER = 'NewRelicID'.freeze
|
@@ -47,10 +47,12 @@ module NewRelic
|
|
47
47
|
def uri
|
48
48
|
case @request.path
|
49
49
|
when /^https?:\/\//
|
50
|
-
|
50
|
+
::NewRelic::Agent::HTTPClients::URIUtil.parse_and_normalize_url(@request.path)
|
51
51
|
else
|
52
52
|
scheme = @connection.use_ssl? ? 'https' : 'http'
|
53
|
-
|
53
|
+
::NewRelic::Agent::HTTPClients::URIUtil.parse_and_normalize_url(
|
54
|
+
"#{scheme}://#{@connection.address}:#{@connection.port}#{@request.path}"
|
55
|
+
)
|
54
56
|
end
|
55
57
|
end
|
56
58
|
end
|
@@ -46,7 +46,7 @@ module NewRelic
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def start_recording_metrics event
|
49
|
-
event.payload[:segment] = Transaction.start_segment metric_name_from_event(event)
|
49
|
+
event.payload[:segment] = Transaction.start_segment name: metric_name_from_event(event)
|
50
50
|
end
|
51
51
|
|
52
52
|
def stop_recording_metrics event
|
@@ -14,7 +14,7 @@ module NewRelic
|
|
14
14
|
event = RenderEvent.new(name, Time.now, nil, id, payload)
|
15
15
|
push_event(event)
|
16
16
|
if state.is_execution_traced? && event.recordable?
|
17
|
-
event.segment = NewRelic::Agent::Transaction.start_segment event.metric_name
|
17
|
+
event.segment = NewRelic::Agent::Transaction.start_segment name: event.metric_name
|
18
18
|
end
|
19
19
|
rescue => e
|
20
20
|
log_notification_error(e, name, 'start')
|
@@ -2,6 +2,8 @@
|
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
3
|
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
|
4
4
|
|
5
|
+
require 'new_relic/agent/instrumentation/active_record_prepend'
|
6
|
+
|
5
7
|
module NewRelic
|
6
8
|
module Agent
|
7
9
|
module Instrumentation
|
@@ -18,7 +20,12 @@ module NewRelic
|
|
18
20
|
|
19
21
|
def self.insert_instrumentation
|
20
22
|
if defined?(::ActiveRecord::VERSION::MAJOR) && ::ActiveRecord::VERSION::MAJOR.to_i >= 3
|
21
|
-
::NewRelic::Agent
|
23
|
+
if ::NewRelic::Agent.config[:prepend_active_record_instrumentation]
|
24
|
+
::ActiveRecord::Base.prepend ::NewRelic::Agent::Instrumentation::ActiveRecordPrepend::BaseExtensions
|
25
|
+
::ActiveRecord::Relation.prepend ::NewRelic::Agent::Instrumentation::ActiveRecordPrepend::RelationExtensions
|
26
|
+
else
|
27
|
+
::NewRelic::Agent::Instrumentation::ActiveRecordHelper.instrument_additional_methods
|
28
|
+
end
|
22
29
|
end
|
23
30
|
|
24
31
|
::ActiveRecord::ConnectionAdapters::AbstractAdapter.module_eval do
|
@@ -60,7 +67,14 @@ module NewRelic
|
|
60
67
|
database = @config && @config[:database]
|
61
68
|
end
|
62
69
|
|
63
|
-
segment = NewRelic::Agent::Transaction.start_datastore_segment(
|
70
|
+
segment = NewRelic::Agent::Transaction.start_datastore_segment(
|
71
|
+
product: product,
|
72
|
+
operation: operation,
|
73
|
+
collection: collection,
|
74
|
+
host: host,
|
75
|
+
port_path_or_id: port_path_or_id,
|
76
|
+
database_name: database
|
77
|
+
)
|
64
78
|
segment._notice_sql(sql, @config, EXPLAINER)
|
65
79
|
|
66
80
|
begin
|
@@ -94,7 +108,7 @@ DependencyDetection.defer do
|
|
94
108
|
executes do
|
95
109
|
require 'new_relic/agent/instrumentation/active_record_helper'
|
96
110
|
|
97
|
-
if defined?(::Rails) && ::Rails::VERSION::MAJOR.to_i == 3
|
111
|
+
if defined?(::Rails::VERSION::MAJOR) && ::Rails::VERSION::MAJOR.to_i == 3
|
98
112
|
ActiveSupport.on_load(:active_record) do
|
99
113
|
::NewRelic::Agent::Instrumentation::ActiveRecord.insert_instrumentation
|
100
114
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
3
|
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
|
4
|
+
|
5
|
+
require 'new_relic/agent/instrumentation/active_record_prepend'
|
4
6
|
require 'new_relic/agent/instrumentation/active_record_subscriber'
|
5
7
|
require 'new_relic/agent/prepend_supportability'
|
6
8
|
|
@@ -28,7 +30,13 @@ DependencyDetection.defer do
|
|
28
30
|
|
29
31
|
ActiveSupport.on_load(:active_record) do
|
30
32
|
::NewRelic::Agent::PrependSupportability.record_metrics_for(::ActiveRecord::Base, ::ActiveRecord::Relation)
|
31
|
-
|
33
|
+
|
34
|
+
if NewRelic::Agent.config[:prepend_active_record_instrumentation]
|
35
|
+
::ActiveRecord::Base.prepend ::NewRelic::Agent::Instrumentation::ActiveRecordPrepend::BaseExtensions
|
36
|
+
::ActiveRecord::Relation.prepend ::NewRelic::Agent::Instrumentation::ActiveRecordPrepend::RelationExtensions
|
37
|
+
else
|
38
|
+
::NewRelic::Agent::Instrumentation::ActiveRecordHelper.instrument_additional_methods
|
39
|
+
end
|
32
40
|
end
|
33
41
|
end
|
34
42
|
end
|
@@ -1,64 +1,9 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
# This file is distributed under New Relic's license terms.
|
3
3
|
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
|
4
|
-
require 'new_relic/agent/instrumentation/active_record_subscriber'
|
5
|
-
require 'new_relic/agent/prepend_supportability'
|
6
|
-
|
7
|
-
module NewRelic
|
8
|
-
module Agent
|
9
|
-
module Instrumentation
|
10
|
-
module ActiveRecord
|
11
|
-
ACTIVE_RECORD = "ActiveRecord".freeze
|
12
|
-
|
13
|
-
module BaseExtensions
|
14
|
-
def save(*args, &blk)
|
15
|
-
::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
|
16
|
-
super
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def save!(*args, &blk)
|
21
|
-
::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
|
22
|
-
super
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
module RelationExtensions
|
28
|
-
def update_all(*args, &blk)
|
29
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
30
|
-
super
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def delete_all(*args, &blk)
|
35
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
36
|
-
super
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def destroy_all(*args, &blk)
|
41
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
42
|
-
super
|
43
|
-
end
|
44
|
-
end
|
45
4
|
|
46
|
-
|
47
|
-
|
48
|
-
super
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def pluck(*args, &blk)
|
53
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
54
|
-
super
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
5
|
+
require 'new_relic/agent/instrumentation/active_record_subscriber'
|
6
|
+
require 'new_relic/agent/instrumentation/active_record_prepend'
|
62
7
|
|
63
8
|
DependencyDetection.defer do
|
64
9
|
named :active_record_5
|
@@ -79,14 +24,13 @@ DependencyDetection.defer do
|
|
79
24
|
end
|
80
25
|
|
81
26
|
executes do
|
82
|
-
::NewRelic::Agent::PrependSupportability.record_metrics_for(::ActiveRecord::Base, ::ActiveRecord::Relation)
|
83
|
-
|
84
27
|
ActiveSupport::Notifications.subscribe('sql.active_record',
|
85
28
|
NewRelic::Agent::Instrumentation::ActiveRecordSubscriber.new)
|
86
29
|
|
87
30
|
ActiveSupport.on_load(:active_record) do
|
88
|
-
::
|
89
|
-
::ActiveRecord::
|
31
|
+
::NewRelic::Agent::PrependSupportability.record_metrics_for(::ActiveRecord::Base, ::ActiveRecord::Relation)
|
32
|
+
::ActiveRecord::Base.prepend ::NewRelic::Agent::Instrumentation::ActiveRecordPrepend::BaseExtensions
|
33
|
+
::ActiveRecord::Relation.prepend ::NewRelic::Agent::Instrumentation::ActiveRecordPrepend::RelationExtensions
|
90
34
|
end
|
91
35
|
end
|
92
36
|
end
|
@@ -0,0 +1,61 @@
|
|
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
|
+
|
5
|
+
require 'new_relic/agent/prepend_supportability'
|
6
|
+
|
7
|
+
module NewRelic
|
8
|
+
module Agent
|
9
|
+
module Instrumentation
|
10
|
+
module ActiveRecordPrepend
|
11
|
+
ACTIVE_RECORD = 'ActiveRecord'.freeze
|
12
|
+
|
13
|
+
module BaseExtensions
|
14
|
+
def save(*args, &blk)
|
15
|
+
::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
|
16
|
+
super
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def save!(*args, &blk)
|
21
|
+
::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
|
22
|
+
super
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
module RelationExtensions
|
28
|
+
def update_all(*args, &blk)
|
29
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
30
|
+
super
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def delete_all(*args, &blk)
|
35
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
36
|
+
super
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def destroy_all(*args, &blk)
|
41
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
42
|
+
super
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def calculate(*args, &blk)
|
47
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
48
|
+
super
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def pluck(*args, &blk)
|
53
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
54
|
+
super
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -104,13 +104,15 @@ DependencyDetection.defer do
|
|
104
104
|
|
105
105
|
def call *args
|
106
106
|
delivery_info, message_properties, _ = args
|
107
|
+
queue_name = queue.respond_to?(:name) ? queue.name : queue
|
108
|
+
|
107
109
|
NewRelic::Agent::Messaging.wrap_amqp_consume_transaction(
|
108
110
|
library: NewRelic::Agent::Instrumentation::Bunny::LIBRARY,
|
109
111
|
destination_name: NewRelic::Agent::Instrumentation::Bunny.exchange_name(delivery_info.exchange),
|
110
112
|
delivery_info: delivery_info,
|
111
113
|
message_properties: message_properties,
|
112
114
|
exchange_type: NewRelic::Agent::Instrumentation::Bunny.exchange_type(delivery_info, channel),
|
113
|
-
queue_name:
|
115
|
+
queue_name: queue_name) do
|
114
116
|
|
115
117
|
call_without_new_relic(*args)
|
116
118
|
end
|
@@ -241,6 +241,7 @@ module NewRelic
|
|
241
241
|
when :grape then ::NewRelic::Agent::Transaction::GRAPE_PREFIX
|
242
242
|
when :rake then ::NewRelic::Agent::Transaction::RAKE_PREFIX
|
243
243
|
when :action_cable then ::NewRelic::Agent::Transaction::ACTION_CABLE_PREFIX
|
244
|
+
when :message then ::NewRelic::Agent::Transaction::MESSAGE_PREFIX
|
244
245
|
else "#{category.to_s}/" # for internal use only
|
245
246
|
end
|
246
247
|
end
|