newrelic_rpm 6.14.0 → 6.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +52 -2
- data/lib/new_relic/agent.rb +1 -0
- data/lib/new_relic/agent/agent.rb +2 -4
- data/lib/new_relic/agent/configuration/default_source.rb +13 -1
- data/lib/new_relic/agent/database_adapter.rb +33 -0
- data/lib/new_relic/agent/instrumentation/active_record_helper.rb +21 -68
- data/lib/new_relic/agent/instrumentation/active_record_prepend.rb +23 -57
- data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +0 -15
- data/lib/new_relic/agent/instrumentation/bunny.rb +27 -71
- data/lib/new_relic/agent/instrumentation/curb.rb +12 -30
- data/lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb +8 -21
- data/lib/new_relic/agent/instrumentation/net.rb +33 -57
- data/lib/new_relic/agent/instrumentation/net_prepend.rb +21 -53
- data/lib/new_relic/agent/instrumentation/padrino.rb +15 -37
- data/lib/new_relic/agent/instrumentation/rack.rb +6 -17
- data/lib/new_relic/agent/instrumentation/rake.rb +19 -53
- data/lib/new_relic/agent/instrumentation/redis.rb +59 -138
- data/lib/new_relic/agent/instrumentation/sidekiq.rb +1 -1
- data/lib/new_relic/agent/instrumentation/sinatra.rb +22 -62
- data/lib/new_relic/agent/span_event_primitive.rb +10 -8
- data/lib/new_relic/agent/transaction/abstract_segment.rb +1 -1
- data/lib/new_relic/agent/vm/mri_vm.rb +6 -4
- data/lib/new_relic/cli/commands/deployments.rb +0 -1
- data/lib/new_relic/dependency_detection.rb +4 -0
- data/lib/new_relic/environment_report.rb +1 -13
- data/lib/new_relic/supportability_helper.rb +1 -0
- data/lib/new_relic/version.rb +1 -1
- data/test/agent_helper.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59fdb006789ae2f1cb776c15084ad1bc7f854abf000573fd11dd2c14882b4273
|
4
|
+
data.tar.gz: 7b8d00cdaa547832fb34c1f76a697b694ff28c9a74be046545e7d3b0866d97e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cadb8ca1d02feadc30a85871d1e8cd6c24064bfc3b1bed98680573bb4c29075e07447f4290dfc360d9607c1ff3a5433d0c36be9eaeae515c725547424ee92cc
|
7
|
+
data.tar.gz: c3901a54a577cdab2159ee6a93bf4bd6acf82d6629d4d4ba99c4565d7155efc7d653387f9fcee8cd246d19cecfe662b60bd63f05cbf19d38194e0b6d9d6ce0b9
|
data/CHANGELOG.md
CHANGED
@@ -1,11 +1,61 @@
|
|
1
1
|
# New Relic Ruby Agent Release Notes #
|
2
2
|
|
3
|
+
## v6.15.0
|
4
|
+
|
5
|
+
* **Official Ruby 3.0 support**
|
6
|
+
|
7
|
+
The ruby agent has been verified to run on ruby 3.0.0
|
8
|
+
|
9
|
+
* **Added support for Rails 6.1**
|
10
|
+
|
11
|
+
The ruby agent has been verified to run with Rails 6.1
|
12
|
+
Special thanks to @hasghari for setting this up!
|
13
|
+
|
14
|
+
* **Added support for Sidekiq 6.0, 6.1**
|
15
|
+
|
16
|
+
The ruby agent has been verified to run with both 6.0 and 6.1 versions of sidekiq
|
17
|
+
|
18
|
+
* **Bugfix: No longer overwrites sidekiq trace data**
|
19
|
+
|
20
|
+
Distributed traing data is now added to the job trace info rather than overwriting the existing data.
|
21
|
+
|
22
|
+
* **Bugfix: Fixes cases where errors are reported for spans with no other attributes**
|
23
|
+
|
24
|
+
Previously, in cases where a span does not have any agent/custom attributes on it, but an error
|
25
|
+
is noticed and recorded against the span, a `FrozenError: can't modify frozen Hash` is thrown.
|
26
|
+
This is now fixed and errors are now correctly recorded against such span events.
|
27
|
+
|
28
|
+
* **Bugfix: `DistributedTracing.insert_distributed_trace_headers` Supportability metric now recorded**
|
29
|
+
|
30
|
+
Previously, API calls to `DistributedTracing.insert_distributed_trace_headers` would lead to an exception
|
31
|
+
about the missing supportability metric rather than flowing through the API implementation as intended.
|
32
|
+
This would potentially lead to broken distributed traces as the trace headers were not inserted on the API call.
|
33
|
+
`DistributedTracing.insert_distributed_trace_headers` now correctly records the supportability metric and
|
34
|
+
inserts the distributed trace headers as intended.
|
35
|
+
|
36
|
+
* **Bugfix: child completions after parent completes sometimes throws exception attempting to access nil parent**
|
37
|
+
|
38
|
+
In scenarios where the child segment/span is completing after the parent in jRuby, the parent may have already
|
39
|
+
been freed and no longer accessible. This would lead to attempting to calll `descendant_complete` on a Nil
|
40
|
+
object. This is fixed to protect against calling the `descendant_complete` in such cases.
|
41
|
+
|
42
|
+
* **Feature: implements `force_install_exit_handler` config flag**
|
43
|
+
|
44
|
+
The `force_install_exit_handler` configuration flag allows an application to instruct the agent to install it's
|
45
|
+
graceful shutdown exit handler, which will send any locally cached data to the New Relic collector prior to the
|
46
|
+
application shutting down. This useful for when the primary framework has an embedded Sinatra application that
|
47
|
+
is otherwise detected and skips installing the exit hook for graceful shutdowns.
|
48
|
+
|
49
|
+
* **Default prepend_net_instrumentation to false**
|
50
|
+
|
51
|
+
Previously, `prepend_net_instrumentation` defaulted to true. However, many gems are still using monkey patching on Net::HTTP, which causes compatibility issues with using prepend. Defaulting this to false minimizes instances of
|
52
|
+
unexpected compatibilty issues.
|
53
|
+
|
3
54
|
## v6.14.0
|
4
55
|
|
5
56
|
* **Bugfix: Method tracers no longer cloning arguments**
|
6
57
|
|
7
|
-
Previously, when calling add_method_tracer with certain combination of arguments, it would lead to the wrapped method's arguments
|
8
|
-
being cloned rather than passed to the original method for manipulation as intended. This has been fixed.
|
58
|
+
Previously, when calling add_method_tracer with certain combination of arguments, it would lead to the wrapped method's arguments being cloned rather than passed to the original method for manipulation as intended. This has been fixed.
|
9
59
|
|
10
60
|
* **Bugfix: Delayed Job instrumentation fixed for Ruby 2.7+**
|
11
61
|
|
data/lib/new_relic/agent.rb
CHANGED
@@ -46,6 +46,7 @@ module NewRelic
|
|
46
46
|
require 'new_relic/agent/error_collector'
|
47
47
|
require 'new_relic/agent/sampler'
|
48
48
|
require 'new_relic/agent/database'
|
49
|
+
require 'new_relic/agent/database_adapter'
|
49
50
|
require 'new_relic/agent/datastores'
|
50
51
|
require 'new_relic/agent/pipe_channel_manager'
|
51
52
|
require 'new_relic/agent/configuration'
|
@@ -395,10 +395,8 @@ module NewRelic
|
|
395
395
|
end
|
396
396
|
|
397
397
|
def should_install_exit_handler?
|
398
|
-
|
399
|
-
|
400
|
-
!sinatra_classic_app?
|
401
|
-
)
|
398
|
+
return false unless Agent.config[:send_data_on_exit]
|
399
|
+
!sinatra_classic_app? || Agent.config[:force_install_exit_handler]
|
402
400
|
end
|
403
401
|
|
404
402
|
def install_exit_handler
|
@@ -703,6 +703,18 @@ module NewRelic
|
|
703
703
|
:allowed_from_server => false,
|
704
704
|
:description => 'Enable or disable retrying failed connections to the New Relic data collection service.'
|
705
705
|
},
|
706
|
+
:force_install_exit_handler => {
|
707
|
+
:default => false,
|
708
|
+
:public => true,
|
709
|
+
:type => Boolean,
|
710
|
+
:allowed_from_server => false,
|
711
|
+
:description => 'Forces the exit handler that sends all cached data to collector ' \
|
712
|
+
'before shuttng down to be installed regardless of detecting scenarios where it generally should not be. ' \
|
713
|
+
'Known use-case for this option is where Sinatra is running as an embedded service within another framework ' \
|
714
|
+
'and the agent is detecting the Sinatra app and skipping the at_exit handler as a result. Sinatra classically ' \
|
715
|
+
'runs the entire application in an at_exit block and would otherwise misbehave if the Agent\'s at_exit handler ' \
|
716
|
+
'is also installed in those circumstances. Note: `send_data_on_exit` should also be set to `true` in tandem with this setting.'
|
717
|
+
},
|
706
718
|
:force_reconnect => {
|
707
719
|
:default => false,
|
708
720
|
:public => false,
|
@@ -831,7 +843,7 @@ module NewRelic
|
|
831
843
|
:description => 'If <code>true</code>, uses Module.prepend rather than alias_method for ActiveRecord instrumentation.'
|
832
844
|
},
|
833
845
|
:prepend_net_instrumentation => {
|
834
|
-
:default =>
|
846
|
+
:default => false,
|
835
847
|
:public => true,
|
836
848
|
:type => Boolean,
|
837
849
|
:allowed_from_server => false,
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# This file is distributed under New Relic's license terms.
|
3
|
+
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
|
4
|
+
|
5
|
+
module NewRelic
|
6
|
+
module Agent
|
7
|
+
class DatabaseAdapter
|
8
|
+
VERSIONS = {
|
9
|
+
'6.1.0' => proc { ActiveRecord::Base.connection_db_config.configuration_hash[:adapter] },
|
10
|
+
'4.0.0' => proc { ActiveRecord::Base.connection_config[:adapter] },
|
11
|
+
'3.0.0' => proc { |env| ActiveRecord::Base.configurations[env]['adapter'] }
|
12
|
+
}
|
13
|
+
|
14
|
+
def self.value
|
15
|
+
return unless defined? ActiveRecord::Base
|
16
|
+
new(::NewRelic::Control.instance.env, ActiveRecord::VERSION::STRING).value
|
17
|
+
end
|
18
|
+
|
19
|
+
attr_reader :env, :version
|
20
|
+
|
21
|
+
def initialize(env, version)
|
22
|
+
@env = env
|
23
|
+
@version = Gem::Version.new(version)
|
24
|
+
end
|
25
|
+
|
26
|
+
def value
|
27
|
+
match = VERSIONS.keys.find { |key| version >= Gem::Version.new(key) }
|
28
|
+
return unless match
|
29
|
+
VERSIONS[match].call(env)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -20,37 +20,19 @@ module NewRelic
|
|
20
20
|
::ActiveRecord::Base.class_eval do
|
21
21
|
alias_method :save_without_newrelic, :save
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
save_without_newrelic(*args, &blk)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
else
|
30
|
-
def save(*args, **kwargs, &blk)
|
31
|
-
::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
|
32
|
-
save_without_newrelic(*args, **kwargs, &blk)
|
33
|
-
end
|
23
|
+
def save(*args, &blk)
|
24
|
+
::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
|
25
|
+
save_without_newrelic(*args, &blk)
|
34
26
|
end
|
35
|
-
|
36
27
|
end
|
37
28
|
|
38
29
|
alias_method :save_without_newrelic!, :save!
|
39
30
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
save_without_newrelic!(*args, &blk)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
else
|
47
|
-
def save!(*args, **kwargs, &blk)
|
48
|
-
::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
|
49
|
-
save_without_newrelic!(*args, **kwargs, &blk)
|
50
|
-
end
|
31
|
+
def save!(*args, &blk)
|
32
|
+
::NewRelic::Agent.with_database_metric_name(self.class.name, nil, ACTIVE_RECORD) do
|
33
|
+
save_without_newrelic!(*args, &blk)
|
51
34
|
end
|
52
35
|
end
|
53
|
-
|
54
36
|
end
|
55
37
|
end
|
56
38
|
|
@@ -58,17 +40,9 @@ module NewRelic
|
|
58
40
|
::ActiveRecord::Relation.class_eval do
|
59
41
|
alias_method :update_all_without_newrelic, :update_all
|
60
42
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
update_all_without_newrelic(*args, &blk)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
else
|
68
|
-
def update_all(*args, **kwargs, &blk)
|
69
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
70
|
-
update_all_without_newrelic(*args, **kwargs, &blk)
|
71
|
-
end
|
43
|
+
def update_all(*args, &blk)
|
44
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
45
|
+
update_all_without_newrelic(*args, &blk)
|
72
46
|
end
|
73
47
|
end
|
74
48
|
|
@@ -90,52 +64,31 @@ module NewRelic
|
|
90
64
|
|
91
65
|
alias_method :destroy_all_without_newrelic, :destroy_all
|
92
66
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
destroy_all_without_newrelic(*args, &blk)
|
97
|
-
end
|
98
|
-
end
|
99
|
-
else
|
100
|
-
def destroy_all(*args, **kwargs, &blk)
|
101
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
102
|
-
destroy_all_without_newrelic(*args, **kwargs, &blk)
|
103
|
-
end
|
67
|
+
def destroy_all(*args, &blk)
|
68
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
69
|
+
destroy_all_without_newrelic(*args, &blk)
|
104
70
|
end
|
105
71
|
end
|
106
72
|
|
73
|
+
|
107
74
|
alias_method :calculate_without_newrelic, :calculate
|
108
75
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
calculate_without_newrelic(*args, &blk)
|
113
|
-
end
|
114
|
-
end
|
115
|
-
else
|
116
|
-
def calculate(*args, **kwargs, &blk)
|
117
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
118
|
-
calculate_without_newrelic(*args, **kwargs, &blk)
|
119
|
-
end
|
76
|
+
def calculate(*args, &blk)
|
77
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
78
|
+
calculate_without_newrelic(*args, &blk)
|
120
79
|
end
|
121
80
|
end
|
122
81
|
|
82
|
+
|
123
83
|
if method_defined?(:pluck)
|
124
84
|
alias_method :pluck_without_newrelic, :pluck
|
125
85
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
pluck_without_newrelic(*args, &blk)
|
130
|
-
end
|
131
|
-
end
|
132
|
-
else
|
133
|
-
def pluck(*args, **kwargs, &blk)
|
134
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
135
|
-
pluck_without_newrelic(*args, **kwargs, &blk)
|
136
|
-
end
|
86
|
+
def pluck(*args, &blk)
|
87
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
88
|
+
pluck_without_newrelic(*args, &blk)
|
137
89
|
end
|
138
90
|
end
|
91
|
+
|
139
92
|
end
|
140
93
|
end
|
141
94
|
end
|
@@ -62,68 +62,34 @@ module NewRelic
|
|
62
62
|
end
|
63
63
|
|
64
64
|
module RelationExtensions
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
super
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
def delete_all(*args, &blk)
|
73
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
74
|
-
super
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def destroy_all(*args, &blk)
|
79
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
80
|
-
super
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
def calculate(*args, &blk)
|
85
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
86
|
-
super
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
def pluck(*args, &blk)
|
91
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
92
|
-
super
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
else
|
97
|
-
def update_all(*args, **kwargs, &blk)
|
98
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
99
|
-
super
|
100
|
-
end
|
65
|
+
def update_all(*args, &blk)
|
66
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
67
|
+
super
|
101
68
|
end
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
end
|
108
|
-
|
109
|
-
def destroy_all(*args, **kwargs, &blk)
|
110
|
-
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
111
|
-
super
|
112
|
-
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def delete_all(*args, &blk)
|
72
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
73
|
+
super
|
113
74
|
end
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
75
|
+
end
|
76
|
+
|
77
|
+
def destroy_all(*args, &blk)
|
78
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
79
|
+
super
|
119
80
|
end
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
81
|
+
end
|
82
|
+
|
83
|
+
def calculate(*args, &blk)
|
84
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
85
|
+
super
|
125
86
|
end
|
87
|
+
end
|
126
88
|
|
89
|
+
def pluck(*args, &blk)
|
90
|
+
::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
|
91
|
+
super
|
92
|
+
end
|
127
93
|
end
|
128
94
|
end
|
129
95
|
end
|
@@ -9,7 +9,6 @@ module NewRelic
|
|
9
9
|
module ActsAsSolrInstrumentation
|
10
10
|
module ParserMethodsInstrumentation
|
11
11
|
|
12
|
-
if RUBY_VERSION < "2.7.0"
|
13
12
|
def parse_query_with_newrelic(*args)
|
14
13
|
self.class.trace_execution_scoped(["SolrClient/ActsAsSolr/query"]) do
|
15
14
|
begin
|
@@ -20,20 +19,6 @@ module NewRelic
|
|
20
19
|
end
|
21
20
|
end
|
22
21
|
end
|
23
|
-
|
24
|
-
else
|
25
|
-
def parse_query_with_newrelic(*args, **kwargs)
|
26
|
-
self.class.trace_execution_scoped(["SolrClient/ActsAsSolr/query"]) do
|
27
|
-
begin
|
28
|
-
parse_query_without_newrelic(*args, **kwargs)
|
29
|
-
ensure
|
30
|
-
return unless txn = ::NewRelic::Agent::Tracer.current_transaction
|
31
|
-
txn.current_segment.params[:statement] = ::NewRelic::Agent::Database.truncate_query(args.first.inspect) rescue nil
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
22
|
end
|
38
23
|
end
|
39
24
|
end
|
@@ -100,48 +100,24 @@ DependencyDetection.defer do
|
|
100
100
|
|
101
101
|
alias_method :purge_without_new_relic, :purge
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
103
|
+
def purge *args
|
104
|
+
begin
|
105
|
+
type = server_named? ? :temporary_queue : :queue
|
106
|
+
segment = NewRelic::Agent::Tracer.start_message_broker_segment(
|
107
|
+
action: :purge,
|
108
|
+
library: NewRelic::Agent::Instrumentation::Bunny::LIBRARY,
|
109
|
+
destination_type: type,
|
110
|
+
destination_name: name
|
111
|
+
)
|
112
|
+
rescue => e
|
113
|
+
NewRelic::Agent.logger.error "Error starting message broker segment in Bunny::Queue#purge", e
|
114
|
+
purge_without_new_relic(*args)
|
115
|
+
else
|
116
|
+
NewRelic::Agent::Tracer.capture_segment_error segment do
|
115
117
|
purge_without_new_relic(*args)
|
116
|
-
else
|
117
|
-
NewRelic::Agent::Tracer.capture_segment_error segment do
|
118
|
-
purge_without_new_relic(*args)
|
119
|
-
end
|
120
|
-
ensure
|
121
|
-
segment.finish if segment
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
else
|
126
|
-
def purge *args, **kwargs
|
127
|
-
begin
|
128
|
-
type = server_named? ? :temporary_queue : :queue
|
129
|
-
segment = NewRelic::Agent::Tracer.start_message_broker_segment(
|
130
|
-
action: :purge,
|
131
|
-
library: NewRelic::Agent::Instrumentation::Bunny::LIBRARY,
|
132
|
-
destination_type: type,
|
133
|
-
destination_name: name
|
134
|
-
)
|
135
|
-
rescue => e
|
136
|
-
NewRelic::Agent.logger.error "Error starting message broker segment in Bunny::Queue#purge", e
|
137
|
-
purge_without_new_relic(*args, **kwargs)
|
138
|
-
else
|
139
|
-
NewRelic::Agent::Tracer.capture_segment_error segment do
|
140
|
-
purge_without_new_relic(*args, **kwargs)
|
141
|
-
end
|
142
|
-
ensure
|
143
|
-
segment.finish if segment
|
144
118
|
end
|
119
|
+
ensure
|
120
|
+
segment.finish if segment
|
145
121
|
end
|
146
122
|
end
|
147
123
|
|
@@ -150,42 +126,22 @@ DependencyDetection.defer do
|
|
150
126
|
class Consumer
|
151
127
|
alias_method :call_without_new_relic, :call
|
152
128
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
queue_name = queue.respond_to?(:name) ? queue.name : queue
|
157
|
-
|
158
|
-
NewRelic::Agent::Messaging.wrap_amqp_consume_transaction(
|
159
|
-
library: NewRelic::Agent::Instrumentation::Bunny::LIBRARY,
|
160
|
-
destination_name: NewRelic::Agent::Instrumentation::Bunny.exchange_name(delivery_info.exchange),
|
161
|
-
delivery_info: delivery_info,
|
162
|
-
message_properties: message_properties,
|
163
|
-
exchange_type: NewRelic::Agent::Instrumentation::Bunny.exchange_type(delivery_info, channel),
|
164
|
-
queue_name: queue_name) do
|
165
|
-
|
166
|
-
call_without_new_relic(*args)
|
167
|
-
end
|
168
|
-
end
|
169
|
-
else
|
170
|
-
def call *args, **kwargs
|
171
|
-
delivery_info, message_properties, _ = args
|
172
|
-
queue_name = queue.respond_to?(:name) ? queue.name : queue
|
129
|
+
def call *args
|
130
|
+
delivery_info, message_properties, _ = args
|
131
|
+
queue_name = queue.respond_to?(:name) ? queue.name : queue
|
173
132
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
133
|
+
NewRelic::Agent::Messaging.wrap_amqp_consume_transaction(
|
134
|
+
library: NewRelic::Agent::Instrumentation::Bunny::LIBRARY,
|
135
|
+
destination_name: NewRelic::Agent::Instrumentation::Bunny.exchange_name(delivery_info.exchange),
|
136
|
+
delivery_info: delivery_info,
|
137
|
+
message_properties: message_properties,
|
138
|
+
exchange_type: NewRelic::Agent::Instrumentation::Bunny.exchange_type(delivery_info, channel),
|
139
|
+
queue_name: queue_name) do
|
181
140
|
|
182
|
-
|
183
|
-
end
|
141
|
+
call_without_new_relic(*args)
|
184
142
|
end
|
185
143
|
end
|
186
144
|
|
187
|
-
|
188
|
-
|
189
145
|
end
|
190
146
|
end
|
191
147
|
end
|