newrelic_rpm 6.1.0.352 → 6.6.0.358
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +34 -96
- data/CHANGELOG.md +139 -0
- data/lib/new_relic/agent/agent.rb +51 -134
- data/lib/new_relic/agent/commands/agent_command_router.rb +2 -21
- data/lib/new_relic/agent/configuration/default_source.rb +53 -41
- data/lib/new_relic/agent/configuration/environment_source.rb +4 -2
- data/lib/new_relic/agent/configuration/event_harvest_config.rb +39 -0
- data/lib/new_relic/agent/configuration/high_security_source.rb +1 -0
- data/lib/new_relic/agent/configuration/manager.rb +13 -1
- data/lib/new_relic/agent/configuration/server_source.rb +34 -1
- data/lib/new_relic/agent/connect/request_builder.rb +69 -0
- data/lib/new_relic/agent/connect/response_handler.rb +61 -0
- data/lib/new_relic/agent/error_collector.rb +2 -2
- data/lib/new_relic/agent/error_event_aggregator.rb +2 -1
- data/lib/new_relic/agent/error_trace_aggregator.rb +1 -0
- data/lib/new_relic/agent/event_aggregator.rb +26 -32
- data/lib/new_relic/agent/hostname.rb +1 -1
- data/lib/new_relic/agent/inbound_request_monitor.rb +2 -2
- data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +24 -42
- data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +46 -74
- data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +70 -53
- data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +168 -0
- data/lib/new_relic/agent/instrumentation/active_record_subscriber.rb +41 -48
- data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +4 -4
- data/lib/new_relic/agent/instrumentation/grape.rb +2 -3
- data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +76 -0
- data/lib/new_relic/agent/instrumentation/{rails5 → rails_notifications}/action_cable.rb +5 -6
- data/lib/new_relic/agent/instrumentation/{rails5 → rails_notifications}/action_controller.rb +3 -3
- data/lib/new_relic/agent/instrumentation/{rails4 → rails_notifications}/action_view.rb +3 -3
- data/lib/new_relic/agent/javascript_instrumentor.rb +1 -1
- data/lib/new_relic/agent/new_relic_service.rb +0 -4
- data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +0 -1
- data/lib/new_relic/agent/parameter_filtering.rb +18 -5
- data/lib/new_relic/agent/priority_sampled_buffer.rb +2 -0
- data/lib/new_relic/agent/span_event_aggregator.rb +2 -5
- 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_event_recorder.rb +3 -3
- data/lib/new_relic/agent/transaction_sampler.rb +1 -5
- data/lib/new_relic/agent/transaction_time_aggregator.rb +19 -4
- data/lib/new_relic/control/class_methods.rb +7 -1
- data/lib/new_relic/control/frameworks/{rails5.rb → rails_notifications.rb} +1 -1
- 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
- data/newrelic_rpm.gemspec +2 -9
- data/test/agent_helper.rb +18 -5
- metadata +18 -51
- 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/instrumentation/active_record_4.rb +0 -42
- data/lib/new_relic/agent/instrumentation/active_record_5.rb +0 -41
- data/lib/new_relic/agent/instrumentation/evented_subscriber.rb +0 -104
- data/lib/new_relic/agent/instrumentation/rails4/action_controller.rb +0 -32
- data/lib/new_relic/agent/instrumentation/rails5/action_view.rb +0 -27
- data/lib/new_relic/agent/transaction/xray_sample_buffer.rb +0 -64
- data/lib/new_relic/control/frameworks/rails6.rb +0 -14
@@ -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
|
+
|
6
|
+
module NewRelic
|
7
|
+
module Agent
|
8
|
+
module Connect
|
9
|
+
|
10
|
+
class ResponseHandler
|
11
|
+
|
12
|
+
def initialize(agent, config)
|
13
|
+
@agent = agent
|
14
|
+
@config = config
|
15
|
+
end
|
16
|
+
|
17
|
+
# Takes a hash of configuration data returned from the
|
18
|
+
# server and uses it to set local variables and to
|
19
|
+
# initialize various parts of the agent that are configured
|
20
|
+
# separately.
|
21
|
+
#
|
22
|
+
# Can accommodate most arbitrary data - anything extra is
|
23
|
+
# ignored unless we say to do something with it here.
|
24
|
+
def configure_agent(config_data)
|
25
|
+
return if config_data == nil
|
26
|
+
|
27
|
+
@agent.agent_id = config_data['agent_run_id']
|
28
|
+
|
29
|
+
security_policies = config_data.delete('security_policies')
|
30
|
+
|
31
|
+
add_server_side_config(config_data)
|
32
|
+
add_security_policy_config(security_policies) if security_policies
|
33
|
+
|
34
|
+
@agent.transaction_rules = RulesEngine.create_transaction_rules(config_data)
|
35
|
+
@agent.stats_engine.metric_rules = RulesEngine.create_metric_rules(config_data)
|
36
|
+
|
37
|
+
# If you're adding something else here to respond to the server-side config,
|
38
|
+
# use Agent.instance.events.subscribe(:initial_configuration_complete) callback instead!
|
39
|
+
end
|
40
|
+
|
41
|
+
def add_server_side_config(config_data)
|
42
|
+
if config_data['agent_config']
|
43
|
+
::NewRelic::Agent.logger.debug "Using config from server"
|
44
|
+
end
|
45
|
+
|
46
|
+
::NewRelic::Agent.logger.debug "Server provided config: #{config_data.inspect}"
|
47
|
+
server_config = NewRelic::Agent::Configuration::ServerSource.new(config_data, @config)
|
48
|
+
@config.replace_or_add_config(server_config)
|
49
|
+
end
|
50
|
+
|
51
|
+
def add_security_policy_config(security_policies)
|
52
|
+
::NewRelic::Agent.logger.info 'Installing security policies'
|
53
|
+
security_policy_source = NewRelic::Agent::Configuration::SecurityPolicySource.new(security_policies)
|
54
|
+
@config.replace_or_add_config(security_policy_source)
|
55
|
+
# drop data collected before applying security policies
|
56
|
+
@agent.drop_buffered_data
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -18,9 +18,9 @@ module NewRelic
|
|
18
18
|
attr_reader :error_trace_aggregator, :error_event_aggregator
|
19
19
|
|
20
20
|
# Returns a new error collector
|
21
|
-
def initialize
|
21
|
+
def initialize events
|
22
22
|
@error_trace_aggregator = ErrorTraceAggregator.new(MAX_ERROR_QUEUE_LENGTH)
|
23
|
-
@error_event_aggregator = ErrorEventAggregator.new
|
23
|
+
@error_event_aggregator = ErrorEventAggregator.new events
|
24
24
|
|
25
25
|
# lookup of exception class names to ignore. Hash for fast access
|
26
26
|
@ignore = {}
|
@@ -13,7 +13,8 @@ module NewRelic
|
|
13
13
|
|
14
14
|
named :ErrorEventAggregator
|
15
15
|
capacity_key :'error_collector.max_event_samples_stored'
|
16
|
-
|
16
|
+
enabled_keys :'error_collector.enabled',
|
17
|
+
:'error_collector.capture_events'
|
17
18
|
buffer_class PrioritySampledBuffer
|
18
19
|
|
19
20
|
def record noticed_error, transaction_payload = nil
|
@@ -91,6 +91,7 @@ module NewRelic
|
|
91
91
|
|
92
92
|
def register_config_callbacks
|
93
93
|
Agent.config.register_callback(:'error_collector.enabled') do |enabled|
|
94
|
+
reset! if enabled == false
|
94
95
|
::NewRelic::Agent.logger.debug "Error traces will #{enabled ? '' : 'not '}be sent to the New Relic service."
|
95
96
|
end
|
96
97
|
end
|
@@ -8,20 +8,6 @@ module NewRelic
|
|
8
8
|
module Agent
|
9
9
|
class EventAggregator
|
10
10
|
class << self
|
11
|
-
# This architecture requires that every aggregator
|
12
|
-
# implementation provide its own `named`, `capacity_key`, and
|
13
|
-
# `enabled_...` settings. In particular, we do not allow
|
14
|
-
# subclasses to share these values from an intermediate
|
15
|
-
# superclass.
|
16
|
-
|
17
|
-
def inherited(subclass)
|
18
|
-
# Prevent uninitialized variable warnings; we have to do
|
19
|
-
# this as soon as the subclass is defined, before its
|
20
|
-
# implementor calls enabled_key() or enabled_fn().
|
21
|
-
subclass.instance_variable_set(:@enabled_key, nil)
|
22
|
-
subclass.instance_variable_set(:@enabled_fn, nil)
|
23
|
-
end
|
24
|
-
|
25
11
|
def named named = nil
|
26
12
|
named ? @named = named.to_s.freeze : @named
|
27
13
|
end
|
@@ -30,10 +16,25 @@ module NewRelic
|
|
30
16
|
key ? @capacity_key = key : @capacity_key
|
31
17
|
end
|
32
18
|
|
33
|
-
|
34
|
-
|
19
|
+
# An aggregator can specify one or more keys to check to see if it is
|
20
|
+
# enabled. Multiple keys will be &&'d and the enabled status of the
|
21
|
+
# aggregator will be reset when agent configuration changes.
|
22
|
+
|
23
|
+
def enabled_keys *keys
|
24
|
+
if keys.empty?
|
25
|
+
@enabled_keys ||= []
|
26
|
+
else
|
27
|
+
@enabled_keys = Array(keys)
|
28
|
+
@enabled_fn = ->(){ @enabled_keys.all? { |k| Agent.config[k] } }
|
29
|
+
end
|
35
30
|
end
|
36
31
|
|
32
|
+
alias_method :enabled_key, :enabled_keys
|
33
|
+
|
34
|
+
# This can be used instead of `enabled_key(s)` for more fine grained
|
35
|
+
# control over whether an aggregator should be enabled. The enabled fn
|
36
|
+
# will be reevaluated after configuration changes
|
37
|
+
|
37
38
|
def enabled_fn fn = nil
|
38
39
|
fn ? @enabled_fn = fn : @enabled_fn
|
39
40
|
end
|
@@ -47,13 +48,13 @@ module NewRelic
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
50
|
-
def initialize
|
51
|
+
def initialize events
|
51
52
|
@lock = Mutex.new
|
52
53
|
@buffer = self.class.buffer_class.new NewRelic::Agent.config[self.class.capacity_key]
|
53
|
-
@enabled = false
|
54
|
+
@enabled = self.class.enabled_fn ? self.class.enabled_fn.call : false
|
54
55
|
@notified_full = false
|
55
56
|
register_capacity_callback
|
56
|
-
register_enabled_callback
|
57
|
+
register_enabled_callback events
|
57
58
|
after_initialize
|
58
59
|
end
|
59
60
|
|
@@ -66,7 +67,6 @@ module NewRelic
|
|
66
67
|
end
|
67
68
|
|
68
69
|
def enabled?
|
69
|
-
return self.class.enabled_fn.call if self.class.enabled_fn
|
70
70
|
@enabled
|
71
71
|
end
|
72
72
|
|
@@ -126,18 +126,12 @@ module NewRelic
|
|
126
126
|
end
|
127
127
|
end
|
128
128
|
|
129
|
-
def register_enabled_callback
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
NewRelic::Agent.config.register_callback(self.class.enabled_key) do |enabled|
|
137
|
-
# intentionally unsynchronized for liveness
|
138
|
-
@enabled = enabled
|
139
|
-
::NewRelic::Agent.logger.debug "#{self.class.named} will #{enabled ? '' : 'not '}be sent to the New Relic service."
|
140
|
-
end
|
129
|
+
def register_enabled_callback events
|
130
|
+
events.subscribe(:server_source_configuration_added) {
|
131
|
+
@enabled = self.class.enabled_fn.call
|
132
|
+
reset! if @enabled == false
|
133
|
+
::NewRelic::Agent.logger.debug "#{self.class.named} will #{@enabled ? '' : 'not '}be sent to the New Relic service."
|
134
|
+
}
|
141
135
|
end
|
142
136
|
|
143
137
|
def notify_if_full
|
@@ -20,8 +20,8 @@ module NewRelic
|
|
20
20
|
attr_reader :obfuscator
|
21
21
|
|
22
22
|
def initialize(events)
|
23
|
-
events.subscribe(:
|
24
|
-
# This requires :encoding_key, so must wait until :
|
23
|
+
events.subscribe(:initial_configuration_complete) do
|
24
|
+
# This requires :encoding_key, so must wait until :initial_configuration_complete
|
25
25
|
setup_obfuscator
|
26
26
|
on_finished_configuring(events)
|
27
27
|
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,81 +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:
|
51
|
-
filtered_params:
|
52
|
-
|
53
|
-
|
54
|
-
|
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,
|
52
|
+
filtered_params: NewRelic::Agent::ParameterFiltering.filter_using_rails(
|
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
|
+
)
|
55
67
|
}
|
56
68
|
)
|
57
69
|
end
|
58
70
|
|
59
|
-
def
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
def filter(params)
|
64
|
-
munged_params = NewRelic::Agent::ParameterFiltering.filter_rails_request_parameters(params)
|
65
|
-
filters = Rails.application.config.filter_parameters
|
66
|
-
ActionDispatch::Http::ParameterFilter.new(filters).filter(munged_params)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
class ControllerEvent < Event
|
71
|
-
attr_accessor :parent
|
72
|
-
attr_reader :queue_start, :request
|
73
|
-
|
74
|
-
def initialize(name, start, ending, transaction_id, payload, request)
|
75
|
-
# We have a different initialize parameter list, so be explicit
|
76
|
-
super(name, start, ending, transaction_id, payload)
|
77
|
-
|
78
|
-
@request = request
|
79
|
-
@controller_class = payload[:controller].split('::') \
|
80
|
-
.inject(Object){|m,o| m.const_get(o)}
|
81
|
-
|
82
|
-
if request && request.respond_to?(:env)
|
83
|
-
@queue_start = QueueTime.parse_frontend_timestamp(request.env, self.time)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
def metric_name
|
88
|
-
@metric_name || "Controller/#{metric_path}/#{metric_action}"
|
89
|
-
end
|
90
|
-
|
91
|
-
def metric_path
|
92
|
-
@controller_class.controller_path
|
93
|
-
end
|
94
|
-
|
95
|
-
def metric_action
|
96
|
-
payload[:action]
|
97
|
-
end
|
98
|
-
|
99
|
-
def ignored?
|
100
|
-
_is_filtered?(ControllerInstrumentation::NR_DO_NOT_TRACE_KEY)
|
101
|
-
end
|
102
|
-
|
103
|
-
def apdex_ignored?
|
104
|
-
_is_filtered?(ControllerInstrumentation::NR_IGNORE_APDEX_KEY)
|
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}"
|
105
74
|
end
|
106
75
|
|
107
|
-
def
|
108
|
-
|
76
|
+
def controller_class(payload)
|
77
|
+
::NewRelic::LanguageSupport.constantize(payload[:controller])
|
109
78
|
end
|
110
79
|
|
111
|
-
def
|
80
|
+
def should_ignore(payload, controller_class)
|
112
81
|
NewRelic::Agent::Instrumentation::IgnoreActions.is_filtered?(
|
113
|
-
|
114
|
-
|
115
|
-
|
82
|
+
ControllerInstrumentation::NR_DO_NOT_TRACE_KEY,
|
83
|
+
controller_class,
|
84
|
+
payload[:action]
|
85
|
+
)
|
116
86
|
end
|
117
87
|
|
118
|
-
def
|
119
|
-
|
88
|
+
def queue_start(request)
|
89
|
+
if request && request.respond_to?(:env)
|
90
|
+
QueueTime.parse_frontend_timestamp(request.env, Time.now)
|
91
|
+
end
|
120
92
|
end
|
121
93
|
end
|
122
94
|
end
|