newrelic_rpm 6.3.0.355 → 6.4.0.356
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -5
- data/CHANGELOG.md +44 -0
- data/lib/new_relic/agent/commands/agent_command_router.rb +2 -21
- data/lib/new_relic/agent/configuration/default_source.rb +1 -29
- data/lib/new_relic/agent/configuration/environment_source.rb +4 -2
- data/lib/new_relic/agent/configuration/high_security_source.rb +1 -0
- data/lib/new_relic/agent/connect/request_builder.rb +5 -0
- data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +24 -42
- data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +45 -69
- data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +70 -53
- data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +29 -8
- data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +33 -47
- data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +2 -2
- data/lib/new_relic/agent/instrumentation/grape.rb +2 -3
- data/lib/new_relic/agent/instrumentation/{evented_subscriber.rb → notifications_subscriber.rb} +7 -66
- data/lib/new_relic/agent/new_relic_service.rb +0 -4
- data/lib/new_relic/agent/threading/backtrace_service.rb +3 -3
- data/lib/new_relic/agent/threading/thread_profile.rb +9 -23
- data/lib/new_relic/agent/transaction.rb +0 -2
- data/lib/new_relic/agent/transaction/trace.rb +3 -8
- data/lib/new_relic/agent/transaction/trace_builder.rb +0 -1
- data/lib/new_relic/agent/transaction_sampler.rb +1 -5
- data/lib/new_relic/rack/browser_monitoring.rb +10 -8
- data/lib/new_relic/version.rb +1 -1
- data/lib/tasks/config.rake +1 -2
- metadata +3 -6
- data/lib/new_relic/agent/commands/xray_session.rb +0 -55
- data/lib/new_relic/agent/commands/xray_session_collection.rb +0 -161
- data/lib/new_relic/agent/transaction/xray_sample_buffer.rb +0 -64
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b076c28227c61e989c31bb41023266f4319602621a913cc403e224d7e5c5822
|
4
|
+
data.tar.gz: '06062208e9ca3921d1d3353ea91dcc84423747496f6744b617053e98d8488a83'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5ab26028a95f4bb69d6ae882733b0796f0e547cae5a0c276413b0c8daf701eed0697a67b4ad87e64c43e9d1359af37dc9a187f41d59cb2e24caa8b6bbd25afe
|
7
|
+
data.tar.gz: d67d418c31585f72e05173c10c858a649ca5f6615dfc80cdfaa25fee451055cf20430aac5602c4553468c7ff5018675b734902674a83a44be27f4e54c077df6c
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,49 @@
|
|
1
1
|
# New Relic Ruby Agent Release Notes #
|
2
2
|
|
3
|
+
## v6.4.0
|
4
|
+
|
5
|
+
* **Custom Metadata Collection**
|
6
|
+
|
7
|
+
The agent now collects environment variables prefixed by `NEW_RELIC_METADATA_`. These
|
8
|
+
may be added to transaction events to provide context between your Kubernetes cluster
|
9
|
+
and your services. For details on the behavior, see
|
10
|
+
[this blog post](https://blog.newrelic.com/engineering/monitoring-application-performance-in-kubernetes/).
|
11
|
+
|
12
|
+
* **Bugfix for faster ActiveRecord connection resolution**
|
13
|
+
|
14
|
+
Version 6.3.0 of the agent backported the faster ActiveRecord connection resolution
|
15
|
+
from Rails 6.0 to previous versions, but the implementation caused certain other gems
|
16
|
+
which measured ActiveRecord performance to stop working. This version of the agent
|
17
|
+
changes the implementation of this performance improvement so no such conflicts occur.
|
18
|
+
|
19
|
+
* **Bugfix for Grape instrumentation error**
|
20
|
+
|
21
|
+
Previous versions of the agent would fail to install Grape instrumentation in Grape
|
22
|
+
versions 1.2.0 and up if the API being instrumented subclassed `Grape::API::Instance`
|
23
|
+
rather than `Grape::API`. A warning would also print to the newrelic_agent log:
|
24
|
+
```
|
25
|
+
WARN : Error in Grape instrumentation
|
26
|
+
WARN : NoMethodError: undefined method `name' for nil:NilClass
|
27
|
+
```
|
28
|
+
|
29
|
+
This version of the agent successfully installs instrumentation for subclasses
|
30
|
+
of `Grape::API::Instance`, and these log messages should no longer appear.
|
31
|
+
|
32
|
+
* **Bugfix for streaming responses**
|
33
|
+
|
34
|
+
Previous versions of the agent would attempt to insert JavaScript instrumentation into
|
35
|
+
any streaming response that did not make use of `ActionController::Live`. This resulted
|
36
|
+
in an empty, non-streamed response being sent to the client.
|
37
|
+
|
38
|
+
This version of the agent will not attempt to insert JavaScript instrumentation into
|
39
|
+
a response which includes the header `Transfer-Encoding=chunked`, which indicates a
|
40
|
+
streaming response.
|
41
|
+
|
42
|
+
This should exclude JavaScript instrumentation for all streamed responses. To include
|
43
|
+
this instrumentation manually, see
|
44
|
+
[Manually instrument via agent API](https://docs.newrelic.com/docs/agents/ruby-agent/features/new-relic-browser-ruby-agent#manual_instrumentation)
|
45
|
+
in our documentation.
|
46
|
+
|
3
47
|
## v6.3.0
|
4
48
|
|
5
49
|
* **Official Rails 6.0 support**
|
@@ -9,7 +9,6 @@
|
|
9
9
|
# like the ThreadProfiler, so it's simpler to just keep it together here.
|
10
10
|
|
11
11
|
require 'new_relic/agent/commands/agent_command'
|
12
|
-
require 'new_relic/agent/commands/xray_session_collection'
|
13
12
|
require 'new_relic/agent/threading/backtrace_service'
|
14
13
|
|
15
14
|
module NewRelic
|
@@ -18,8 +17,7 @@ module NewRelic
|
|
18
17
|
class AgentCommandRouter
|
19
18
|
attr_reader :handlers
|
20
19
|
|
21
|
-
attr_accessor :thread_profiler_session, :backtrace_service
|
22
|
-
:xray_session_collection
|
20
|
+
attr_accessor :thread_profiler_session, :backtrace_service
|
23
21
|
|
24
22
|
def initialize(event_listener=nil)
|
25
23
|
@handlers = Hash.new { |*| Proc.new { |cmd| self.unrecognized_agent_command(cmd) } }
|
@@ -27,11 +25,9 @@ module NewRelic
|
|
27
25
|
@backtrace_service = Threading::BacktraceService.new(event_listener)
|
28
26
|
|
29
27
|
@thread_profiler_session = ThreadProfilerSession.new(@backtrace_service)
|
30
|
-
@xray_session_collection = XraySessionCollection.new(@backtrace_service, event_listener)
|
31
28
|
|
32
29
|
@handlers['start_profiler'] = Proc.new { |cmd| thread_profiler_session.handle_start_command(cmd) }
|
33
30
|
@handlers['stop_profiler'] = Proc.new { |cmd| thread_profiler_session.handle_stop_command(cmd) }
|
34
|
-
@handlers['active_xray_sessions'] = Proc.new { |cmd| xray_session_collection.handle_active_xray_sessions(cmd) }
|
35
31
|
|
36
32
|
if event_listener
|
37
33
|
event_listener.subscribe(:before_shutdown, &method(:on_before_shutdown))
|
@@ -45,20 +41,10 @@ module NewRelic
|
|
45
41
|
def check_for_and_handle_agent_commands
|
46
42
|
commands = get_agent_commands
|
47
43
|
|
48
|
-
stop_xray_sessions unless active_xray_command?(commands)
|
49
|
-
|
50
44
|
results = invoke_commands(commands)
|
51
45
|
new_relic_service.agent_command_results(results) unless results.empty?
|
52
46
|
end
|
53
47
|
|
54
|
-
def stop_xray_sessions
|
55
|
-
self.xray_session_collection.stop_all_sessions
|
56
|
-
end
|
57
|
-
|
58
|
-
def active_xray_command?(commands)
|
59
|
-
commands.any? {|command| command.name == 'active_xray_sessions'}
|
60
|
-
end
|
61
|
-
|
62
48
|
def on_before_shutdown(*args)
|
63
49
|
if self.thread_profiler_session.running?
|
64
50
|
self.thread_profiler_session.stop(true)
|
@@ -67,7 +53,6 @@ module NewRelic
|
|
67
53
|
|
68
54
|
def harvest!
|
69
55
|
profiles = []
|
70
|
-
profiles += harvest_from_xray_session_collection
|
71
56
|
profiles += harvest_from_thread_profiler_session
|
72
57
|
log_profiles(profiles)
|
73
58
|
profiles
|
@@ -76,14 +61,10 @@ module NewRelic
|
|
76
61
|
# We don't currently support merging thread profiles that failed to send
|
77
62
|
# back into the AgentCommandRouter, so we just no-op this method.
|
78
63
|
# Same with reset! - we don't support asynchronous cancellation of a
|
79
|
-
# running thread profile
|
64
|
+
# running thread profile currently.
|
80
65
|
def merge!(*args); end
|
81
66
|
def reset!; end
|
82
67
|
|
83
|
-
def harvest_from_xray_session_collection
|
84
|
-
self.xray_session_collection.harvest_thread_profiles
|
85
|
-
end
|
86
|
-
|
87
68
|
def harvest_from_thread_profiler_session
|
88
69
|
if self.thread_profiler_session.ready_to_harvest?
|
89
70
|
self.thread_profiler_session.stop(true)
|
@@ -1171,35 +1171,7 @@ module NewRelic
|
|
1171
1171
|
:allowed_from_server => true,
|
1172
1172
|
:description => 'If <code>true</code>, enables use of the <a href="https://docs.newrelic.com/docs/apm/applications-menu/events/thread-profiler-tool">thread profiler</a>.'
|
1173
1173
|
},
|
1174
|
-
:'
|
1175
|
-
:default => true,
|
1176
|
-
:public => true,
|
1177
|
-
:type => Boolean,
|
1178
|
-
:allowed_from_server => true,
|
1179
|
-
:description => 'If <code>true</code>, enables <a href="https://docs.newrelic.com/docs/apm/transactions-menu/x-ray-sessions/x-ray-sessions">X-Ray sessions</a>.'
|
1180
|
-
},
|
1181
|
-
:'xray_session.allow_traces' => {
|
1182
|
-
:default => true,
|
1183
|
-
:public => false,
|
1184
|
-
:type => Boolean,
|
1185
|
-
:allowed_from_server => true,
|
1186
|
-
:description => 'Enable or disable X-Ray sessions recording transaction traces.'
|
1187
|
-
},
|
1188
|
-
:'xray_session.allow_profiles' => {
|
1189
|
-
:default => true,
|
1190
|
-
:public => false,
|
1191
|
-
:type => Boolean,
|
1192
|
-
:allowed_from_server => true,
|
1193
|
-
:description => 'Enable or disable X-Ray sessions taking thread profiles.'
|
1194
|
-
},
|
1195
|
-
:'xray_session.max_samples' => {
|
1196
|
-
:default => 10,
|
1197
|
-
:public => false,
|
1198
|
-
:type => Integer,
|
1199
|
-
:allowed_from_server => true,
|
1200
|
-
:description => 'Maximum number of transaction traces to buffer for active X-Ray sessions'
|
1201
|
-
},
|
1202
|
-
:'xray_session.max_profile_overhead' => {
|
1174
|
+
:'thread_profiler.max_profile_overhead' => {
|
1203
1175
|
:default => 0.05,
|
1204
1176
|
:public => false,
|
1205
1177
|
:type => Float,
|
@@ -9,7 +9,8 @@ module NewRelic
|
|
9
9
|
SUPPORTED_PREFIXES = /^new_relic_|^newrelic_/i
|
10
10
|
SPECIAL_CASE_KEYS = [
|
11
11
|
'NEW_RELIC_ENV', # read by NewRelic::Control::Frameworks::Ruby
|
12
|
-
'NEW_RELIC_LOG' # read by set_log_file
|
12
|
+
'NEW_RELIC_LOG', # read by set_log_file
|
13
|
+
/^NEW_RELIC_METADATA_/ # read by NewRelic::Agent::Connect::RequestBuilder
|
13
14
|
]
|
14
15
|
|
15
16
|
attr_accessor :alias_map, :type_map
|
@@ -66,7 +67,8 @@ module NewRelic
|
|
66
67
|
nr_env_var_keys = collect_new_relic_environment_variable_keys
|
67
68
|
|
68
69
|
nr_env_var_keys.each do |key|
|
69
|
-
next if SPECIAL_CASE_KEYS.
|
70
|
+
next if SPECIAL_CASE_KEYS.any? { |pattern| pattern === key.upcase }
|
71
|
+
|
70
72
|
set_value_from_environment_variable(key)
|
71
73
|
end
|
72
74
|
end
|
@@ -13,6 +13,7 @@ module NewRelic
|
|
13
13
|
:capture_params => false,
|
14
14
|
:'resque.capture_params' => false,
|
15
15
|
:'sidekiq.capture_params' => false,
|
16
|
+
:'attributes.include' => [],
|
16
17
|
|
17
18
|
:'transaction_tracer.record_sql' => record_sql_setting(local_settings, :'transaction_tracer.record_sql'),
|
18
19
|
:'slow_sql.record_sql' => record_sql_setting(local_settings, :'slow_sql.record_sql'),
|
@@ -29,6 +29,7 @@ module NewRelic
|
|
29
29
|
:labels => Agent.config.parsed_labels,
|
30
30
|
:agent_version => NewRelic::VERSION::STRING,
|
31
31
|
:environment => sanitize_environment_report(environment_report),
|
32
|
+
:metadata => environment_metadata,
|
32
33
|
:settings => Agent.config.to_collector_hash,
|
33
34
|
:high_security => Agent.config[:high_security],
|
34
35
|
:utilization => UtilizationData.new.to_collector_hash,
|
@@ -54,6 +55,10 @@ module NewRelic
|
|
54
55
|
Agent.config[:send_environment_info] ? Array(EnvironmentReport.new) : []
|
55
56
|
end
|
56
57
|
|
58
|
+
def environment_metadata
|
59
|
+
ENV.select {|k, v| k =~ /^NEW_RELIC_METADATA_/}
|
60
|
+
end
|
61
|
+
|
57
62
|
def local_host
|
58
63
|
NewRelic::Agent::Hostname.get
|
59
64
|
end
|
@@ -1,77 +1,59 @@
|
|
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/
|
4
|
+
require 'new_relic/agent/instrumentation/notifications_subscriber'
|
5
5
|
|
6
6
|
module NewRelic
|
7
7
|
module Agent
|
8
8
|
module Instrumentation
|
9
|
-
class ActionCableSubscriber <
|
9
|
+
class ActionCableSubscriber < NotificationsSubscriber
|
10
10
|
|
11
11
|
PERFORM_ACTION = 'perform_action.action_cable'.freeze
|
12
12
|
|
13
|
-
def start
|
13
|
+
def start(name, id, payload) #THREAD_LOCAL_ACCESS
|
14
14
|
return unless state.is_execution_traced?
|
15
|
-
|
16
|
-
if
|
17
|
-
|
15
|
+
|
16
|
+
finishable = if name == PERFORM_ACTION
|
17
|
+
Tracer.start_transaction_or_segment(
|
18
|
+
name: transaction_name_from_payload(payload),
|
19
|
+
category: :action_cable
|
20
|
+
)
|
18
21
|
else
|
19
|
-
|
22
|
+
Tracer.start_segment(name: metric_name_from_payload(name, payload))
|
20
23
|
end
|
24
|
+
push_segment(id, finishable)
|
21
25
|
rescue => e
|
22
26
|
log_notification_error e, name, 'start'
|
23
27
|
end
|
24
28
|
|
25
|
-
def finish
|
29
|
+
def finish(name, id, payload) #THREAD_LOCAL_ACCESS
|
26
30
|
return unless state.is_execution_traced?
|
27
|
-
|
31
|
+
|
28
32
|
notice_error payload if payload.key? :exception
|
29
|
-
|
30
|
-
|
31
|
-
else
|
32
|
-
stop_recording_metrics event
|
33
|
-
end
|
33
|
+
finishable = pop_segment(id)
|
34
|
+
finishable.finish if finishable
|
34
35
|
rescue => e
|
35
36
|
log_notification_error e, name, 'finish'
|
36
37
|
end
|
37
38
|
|
38
39
|
private
|
39
40
|
|
40
|
-
def
|
41
|
-
|
42
|
-
name: transaction_name_from_event(event),
|
43
|
-
category: :action_cable
|
44
|
-
)
|
45
|
-
end
|
46
|
-
|
47
|
-
def finish_transaction event
|
48
|
-
(finishable = event.payload[:finishable]) && finishable.finish
|
49
|
-
end
|
50
|
-
|
51
|
-
def start_recording_metrics event
|
52
|
-
event.payload[:segment] = Tracer.start_segment name: metric_name_from_event(event)
|
53
|
-
end
|
54
|
-
|
55
|
-
def stop_recording_metrics event
|
56
|
-
event.payload[:segment].finish if event.payload[:segment]
|
57
|
-
end
|
58
|
-
|
59
|
-
def transaction_name_from_event event
|
60
|
-
"Controller/ActionCable/#{event.payload[:channel_class]}/#{event.payload[:action]}"
|
41
|
+
def transaction_name_from_payload(payload)
|
42
|
+
"Controller/ActionCable/#{payload[:channel_class]}/#{payload[:action]}"
|
61
43
|
end
|
62
44
|
|
63
|
-
def
|
64
|
-
"Ruby/ActionCable/#{
|
45
|
+
def metric_name_from_payload(name, payload)
|
46
|
+
"Ruby/ActionCable/#{payload[:channel_class]}/#{action_name(name)}"
|
65
47
|
end
|
66
48
|
|
67
|
-
DOT_ACTION_CABLE =
|
68
|
-
EMPTY_STRING =
|
49
|
+
DOT_ACTION_CABLE = '.action_cable'.freeze
|
50
|
+
EMPTY_STRING = ''.freeze
|
69
51
|
|
70
|
-
def
|
71
|
-
|
52
|
+
def action_name(name)
|
53
|
+
name.gsub DOT_ACTION_CABLE, EMPTY_STRING
|
72
54
|
end
|
73
55
|
|
74
|
-
def notice_error
|
56
|
+
def notice_error(payload)
|
75
57
|
NewRelic::Agent.notice_error payload[:exception_object]
|
76
58
|
end
|
77
59
|
end
|
@@ -1,24 +1,24 @@
|
|
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/
|
4
|
+
require 'new_relic/agent/instrumentation/notifications_subscriber'
|
5
5
|
require 'new_relic/agent/instrumentation/ignore_actions'
|
6
6
|
require 'new_relic/agent/parameter_filtering'
|
7
7
|
|
8
8
|
module NewRelic
|
9
9
|
module Agent
|
10
10
|
module Instrumentation
|
11
|
-
class ActionControllerSubscriber <
|
11
|
+
class ActionControllerSubscriber < NotificationsSubscriber
|
12
12
|
|
13
13
|
def start(name, id, payload) #THREAD_LOCAL_ACCESS
|
14
14
|
# @req is a historically stable but not guaranteed Rails header property
|
15
15
|
request = payload[:headers].instance_variable_get(:@req)
|
16
16
|
|
17
|
-
|
18
|
-
push_event(event)
|
17
|
+
controller_class = controller_class(payload)
|
19
18
|
|
20
|
-
if state.is_execution_traced? && !
|
21
|
-
|
19
|
+
if state.is_execution_traced? && !should_ignore(payload, controller_class)
|
20
|
+
finishable = start_transaction_or_segment(payload, request, controller_class)
|
21
|
+
push_segment(id, finishable)
|
22
22
|
else
|
23
23
|
# if this transaction is ignored, make sure child
|
24
24
|
# transaction are also ignored
|
@@ -30,11 +30,12 @@ module NewRelic
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def finish(name, id, payload) #THREAD_LOCAL_ACCESS
|
33
|
-
|
34
|
-
event.payload.merge!(payload)
|
33
|
+
finishable = pop_segment(id)
|
35
34
|
|
36
|
-
if state.is_execution_traced?
|
37
|
-
|
35
|
+
if state.is_execution_traced? \
|
36
|
+
&& !should_ignore(payload, controller_class(payload))
|
37
|
+
|
38
|
+
finishable.finish
|
38
39
|
else
|
39
40
|
Agent.instance.pop_trace_execution_flag
|
40
41
|
end
|
@@ -42,77 +43,52 @@ module NewRelic
|
|
42
43
|
log_notification_error(e, name, 'finish')
|
43
44
|
end
|
44
45
|
|
45
|
-
def
|
46
|
-
|
47
|
-
name:
|
48
|
-
category:
|
49
|
-
options:
|
50
|
-
request:
|
46
|
+
def start_transaction_or_segment(payload, request, controller_class)
|
47
|
+
Tracer.start_transaction_or_segment(
|
48
|
+
name: format_metric_name(payload[:action], controller_class),
|
49
|
+
category: :controller,
|
50
|
+
options: {
|
51
|
+
request: request,
|
51
52
|
filtered_params: NewRelic::Agent::ParameterFiltering.filter_using_rails(
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
53
|
+
payload[:params],
|
54
|
+
Rails.application.config.filter_parameters
|
55
|
+
),
|
56
|
+
apdex_start_time: queue_start(request),
|
57
|
+
ignore_apdex: NewRelic::Agent::Instrumentation::IgnoreActions.is_filtered?(
|
58
|
+
ControllerInstrumentation::NR_IGNORE_APDEX_KEY,
|
59
|
+
controller_class,
|
60
|
+
payload[:action]
|
61
|
+
),
|
62
|
+
ignore_enduser: NewRelic::Agent::Instrumentation::IgnoreActions.is_filtered?(
|
63
|
+
ControllerInstrumentation::NR_IGNORE_ENDUSER_KEY,
|
64
|
+
controller_class,
|
65
|
+
payload[:action]
|
66
|
+
)
|
57
67
|
}
|
58
68
|
)
|
59
69
|
end
|
60
70
|
|
61
|
-
def
|
62
|
-
|
63
|
-
|
64
|
-
end
|
65
|
-
|
66
|
-
class ControllerEvent < Event
|
67
|
-
attr_accessor :parent
|
68
|
-
attr_reader :queue_start, :request
|
69
|
-
|
70
|
-
def initialize(name, start, ending, transaction_id, payload, request)
|
71
|
-
# We have a different initialize parameter list, so be explicit
|
72
|
-
super(name, start, ending, transaction_id, payload)
|
73
|
-
|
74
|
-
@request = request
|
75
|
-
@controller_class = payload[:controller].split('::') \
|
76
|
-
.inject(Object){|m,o| m.const_get(o)}
|
77
|
-
|
78
|
-
if request && request.respond_to?(:env)
|
79
|
-
@queue_start = QueueTime.parse_frontend_timestamp(request.env, self.time)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def metric_name
|
84
|
-
@metric_name || "Controller/#{metric_path}/#{metric_action}"
|
71
|
+
def format_metric_name(metric_action, controller_name)
|
72
|
+
controller_class = ::NewRelic::LanguageSupport.constantize(controller_name)
|
73
|
+
"Controller/#{controller_class.controller_path}/#{metric_action}"
|
85
74
|
end
|
86
75
|
|
87
|
-
def
|
88
|
-
|
76
|
+
def controller_class(payload)
|
77
|
+
::NewRelic::LanguageSupport.constantize(payload[:controller])
|
89
78
|
end
|
90
79
|
|
91
|
-
def
|
92
|
-
payload[:action]
|
93
|
-
end
|
94
|
-
|
95
|
-
def ignored?
|
96
|
-
_is_filtered?(ControllerInstrumentation::NR_DO_NOT_TRACE_KEY)
|
97
|
-
end
|
98
|
-
|
99
|
-
def apdex_ignored?
|
100
|
-
_is_filtered?(ControllerInstrumentation::NR_IGNORE_APDEX_KEY)
|
101
|
-
end
|
102
|
-
|
103
|
-
def enduser_ignored?
|
104
|
-
_is_filtered?(ControllerInstrumentation::NR_IGNORE_ENDUSER_KEY)
|
105
|
-
end
|
106
|
-
|
107
|
-
def _is_filtered?(key)
|
80
|
+
def should_ignore(payload, controller_class)
|
108
81
|
NewRelic::Agent::Instrumentation::IgnoreActions.is_filtered?(
|
109
|
-
|
110
|
-
|
111
|
-
|
82
|
+
ControllerInstrumentation::NR_DO_NOT_TRACE_KEY,
|
83
|
+
controller_class,
|
84
|
+
payload[:action]
|
85
|
+
)
|
112
86
|
end
|
113
87
|
|
114
|
-
def
|
115
|
-
|
88
|
+
def queue_start(request)
|
89
|
+
if request && request.respond_to?(:env)
|
90
|
+
QueueTime.parse_frontend_timestamp(request.env, Time.now)
|
91
|
+
end
|
116
92
|
end
|
117
93
|
end
|
118
94
|
end
|