newrelic_rpm 7.1.0 → 8.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/CHANGELOG.md +189 -6
  4. data/README.md +5 -1
  5. data/lib/new_relic/agent/adaptive_sampler.rb +2 -2
  6. data/lib/new_relic/agent/agent.rb +6 -6
  7. data/lib/new_relic/agent/commands/thread_profiler_session.rb +7 -3
  8. data/lib/new_relic/agent/configuration/default_source.rb +86 -15
  9. data/lib/new_relic/agent/configuration/event_harvest_config.rb +28 -12
  10. data/lib/new_relic/agent/configuration/manager.rb +1 -2
  11. data/lib/new_relic/agent/configuration/server_source.rb +3 -2
  12. data/lib/new_relic/agent/configuration/yaml_source.rb +22 -1
  13. data/lib/new_relic/agent/connect/request_builder.rb +4 -2
  14. data/lib/new_relic/agent/custom_event_aggregator.rb +2 -1
  15. data/lib/new_relic/agent/database.rb +5 -2
  16. data/lib/new_relic/agent/datastores/mongo.rb +5 -10
  17. data/lib/new_relic/agent/datastores.rb +7 -7
  18. data/lib/new_relic/agent/distributed_tracing/cross_app_payload.rb +5 -5
  19. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +10 -6
  20. data/lib/new_relic/agent/distributed_tracing/distributed_trace_attributes.rb +0 -1
  21. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +1 -1
  22. data/lib/new_relic/agent/distributed_tracing/trace_context_payload.rb +6 -6
  23. data/lib/new_relic/agent/error_collector.rb +52 -37
  24. data/lib/new_relic/agent/error_filter.rb +175 -0
  25. data/lib/new_relic/agent/event_loop.rb +6 -6
  26. data/lib/new_relic/agent/external.rb +0 -32
  27. data/lib/new_relic/agent/http_clients/abstract.rb +2 -2
  28. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +7 -1
  29. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +1 -1
  30. data/lib/new_relic/agent/instrumentation/active_merchant.rb +3 -3
  31. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +1 -1
  32. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -1
  33. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +4 -4
  34. data/lib/new_relic/agent/instrumentation/excon.rb +4 -23
  35. data/lib/new_relic/agent/instrumentation/logger/chain.rb +21 -0
  36. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +59 -0
  37. data/lib/new_relic/agent/instrumentation/logger/prepend.rb +13 -0
  38. data/lib/new_relic/agent/instrumentation/logger.rb +25 -0
  39. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +5 -1
  40. data/lib/new_relic/agent/instrumentation/memcache/helper.rb +5 -0
  41. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +8 -2
  42. data/lib/new_relic/agent/instrumentation/mongo.rb +3 -141
  43. data/lib/new_relic/agent/instrumentation/padrino/chain.rb +23 -19
  44. data/lib/new_relic/agent/instrumentation/padrino/prepend.rb +1 -1
  45. data/lib/new_relic/agent/instrumentation/padrino.rb +4 -2
  46. data/lib/new_relic/agent/instrumentation/queue_time.rb +4 -4
  47. data/lib/new_relic/agent/instrumentation/rack/chain.rb +3 -2
  48. data/lib/new_relic/agent/instrumentation/rack/prepend.rb +2 -1
  49. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +5 -41
  50. data/lib/new_relic/agent/instrumentation/resque.rb +2 -2
  51. data/lib/new_relic/agent/instrumentation/sidekiq.rb +6 -1
  52. data/lib/new_relic/agent/instrumentation/tilt/chain.rb +24 -0
  53. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +41 -0
  54. data/lib/new_relic/agent/instrumentation/tilt/prepend.rb +13 -0
  55. data/lib/new_relic/agent/instrumentation/tilt.rb +25 -0
  56. data/lib/new_relic/agent/javascript_instrumentor.rb +3 -3
  57. data/lib/new_relic/agent/logging.rb +5 -6
  58. data/lib/new_relic/agent/messaging.rb +10 -24
  59. data/lib/new_relic/agent/method_tracer.rb +137 -138
  60. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +8 -1
  61. data/lib/new_relic/agent/new_relic_service.rb +16 -23
  62. data/lib/new_relic/agent/pipe_channel_manager.rb +10 -6
  63. data/lib/new_relic/agent/pipe_service.rb +1 -1
  64. data/lib/new_relic/agent/samplers/cpu_sampler.rb +1 -1
  65. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +9 -6
  66. data/lib/new_relic/agent/span_event_aggregator.rb +2 -2
  67. data/lib/new_relic/agent/sql_sampler.rb +1 -1
  68. data/lib/new_relic/agent/stats_engine/stats_hash.rb +1 -1
  69. data/lib/new_relic/agent/stats_engine.rb +1 -1
  70. data/lib/new_relic/agent/threading/backtrace_service.rb +4 -5
  71. data/lib/new_relic/agent/threading/thread_profile.rb +1 -1
  72. data/lib/new_relic/agent/tracer.rb +15 -37
  73. data/lib/new_relic/agent/transaction/abstract_segment.rb +3 -3
  74. data/lib/new_relic/agent/transaction/datastore_segment.rb +3 -0
  75. data/lib/new_relic/agent/transaction/distributed_tracer.rb +1 -0
  76. data/lib/new_relic/agent/transaction/external_request_segment.rb +3 -0
  77. data/lib/new_relic/agent/transaction/message_broker_segment.rb +5 -11
  78. data/lib/new_relic/agent/transaction/segment.rb +3 -0
  79. data/lib/new_relic/agent/transaction.rb +7 -28
  80. data/lib/new_relic/agent/transaction_time_aggregator.rb +5 -5
  81. data/lib/new_relic/agent/vm/snapshot.rb +1 -1
  82. data/lib/new_relic/agent/worker_loop.rb +5 -5
  83. data/lib/new_relic/agent.rb +6 -5
  84. data/lib/new_relic/cli/commands/deployments.rb +2 -2
  85. data/lib/new_relic/constants.rb +0 -4
  86. data/lib/new_relic/noticed_error.rb +4 -4
  87. data/lib/new_relic/version.rb +2 -2
  88. data/lib/newrelic_rpm.rb +10 -34
  89. data/lib/tasks/all.rb +1 -1
  90. data/newrelic.yml +580 -3
  91. data/newrelic_rpm.gemspec +1 -1
  92. data/test/agent_helper.rb +27 -2
  93. metadata +12 -11
  94. data/lib/new_relic/agent/datastores/mongo/statement_formatter.rb +0 -53
  95. data/lib/new_relic/agent/instrumentation/excon/connection.rb +0 -49
  96. data/lib/new_relic/agent/instrumentation/merb/controller.rb +0 -44
  97. data/lib/new_relic/agent/instrumentation/merb/errors.rb +0 -33
  98. data/lib/new_relic/agent/instrumentation/rails/action_controller.rb +0 -125
  99. data/lib/new_relic/agent/instrumentation/rails/action_web_service.rb +0 -46
  100. data/lib/new_relic/agent/supported_versions.rb +0 -275
  101. data/lib/new_relic/control/frameworks/merb.rb +0 -29
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.0
4
+ version: 8.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Huntsman
8
8
  - Tanna McClure
9
- - Michael Lang
9
+ - Kayla Reopelle
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-06-03 00:00:00.000000000 Z
13
+ date: 2021-11-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake
@@ -261,7 +261,6 @@ files:
261
261
  - lib/new_relic/agent/datastores/mongo/event_formatter.rb
262
262
  - lib/new_relic/agent/datastores/mongo/metric_translator.rb
263
263
  - lib/new_relic/agent/datastores/mongo/obfuscator.rb
264
- - lib/new_relic/agent/datastores/mongo/statement_formatter.rb
265
264
  - lib/new_relic/agent/datastores/redis.rb
266
265
  - lib/new_relic/agent/deprecator.rb
267
266
  - lib/new_relic/agent/distributed_tracing.rb
@@ -276,6 +275,7 @@ files:
276
275
  - lib/new_relic/agent/encoding_normalizer.rb
277
276
  - lib/new_relic/agent/error_collector.rb
278
277
  - lib/new_relic/agent/error_event_aggregator.rb
278
+ - lib/new_relic/agent/error_filter.rb
279
279
  - lib/new_relic/agent/error_trace_aggregator.rb
280
280
  - lib/new_relic/agent/event_aggregator.rb
281
281
  - lib/new_relic/agent/event_buffer.rb
@@ -324,7 +324,6 @@ files:
324
324
  - lib/new_relic/agent/instrumentation/delayed_job/prepend.rb
325
325
  - lib/new_relic/agent/instrumentation/delayed_job_instrumentation.rb
326
326
  - lib/new_relic/agent/instrumentation/excon.rb
327
- - lib/new_relic/agent/instrumentation/excon/connection.rb
328
327
  - lib/new_relic/agent/instrumentation/excon/middleware.rb
329
328
  - lib/new_relic/agent/instrumentation/grape.rb
330
329
  - lib/new_relic/agent/instrumentation/grape/chain.rb
@@ -339,14 +338,16 @@ files:
339
338
  - lib/new_relic/agent/instrumentation/httprb/instrumentation.rb
340
339
  - lib/new_relic/agent/instrumentation/httprb/prepend.rb
341
340
  - lib/new_relic/agent/instrumentation/ignore_actions.rb
341
+ - lib/new_relic/agent/instrumentation/logger.rb
342
+ - lib/new_relic/agent/instrumentation/logger/chain.rb
343
+ - lib/new_relic/agent/instrumentation/logger/instrumentation.rb
344
+ - lib/new_relic/agent/instrumentation/logger/prepend.rb
342
345
  - lib/new_relic/agent/instrumentation/memcache.rb
343
346
  - lib/new_relic/agent/instrumentation/memcache/chain.rb
344
347
  - lib/new_relic/agent/instrumentation/memcache/dalli.rb
345
348
  - lib/new_relic/agent/instrumentation/memcache/helper.rb
346
349
  - lib/new_relic/agent/instrumentation/memcache/instrumentation.rb
347
350
  - lib/new_relic/agent/instrumentation/memcache/prepend.rb
348
- - lib/new_relic/agent/instrumentation/merb/controller.rb
349
- - lib/new_relic/agent/instrumentation/merb/errors.rb
350
351
  - lib/new_relic/agent/instrumentation/middleware_proxy.rb
351
352
  - lib/new_relic/agent/instrumentation/middleware_tracing.rb
352
353
  - lib/new_relic/agent/instrumentation/mongo.rb
@@ -367,8 +368,6 @@ files:
367
368
  - lib/new_relic/agent/instrumentation/rack/helpers.rb
368
369
  - lib/new_relic/agent/instrumentation/rack/instrumentation.rb
369
370
  - lib/new_relic/agent/instrumentation/rack/prepend.rb
370
- - lib/new_relic/agent/instrumentation/rails/action_controller.rb
371
- - lib/new_relic/agent/instrumentation/rails/action_web_service.rb
372
371
  - lib/new_relic/agent/instrumentation/rails3/action_controller.rb
373
372
  - lib/new_relic/agent/instrumentation/rails_middleware.rb
374
373
  - lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb
@@ -398,6 +397,10 @@ files:
398
397
  - lib/new_relic/agent/instrumentation/sinatra/prepend.rb
399
398
  - lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb
400
399
  - lib/new_relic/agent/instrumentation/sunspot.rb
400
+ - lib/new_relic/agent/instrumentation/tilt.rb
401
+ - lib/new_relic/agent/instrumentation/tilt/chain.rb
402
+ - lib/new_relic/agent/instrumentation/tilt/instrumentation.rb
403
+ - lib/new_relic/agent/instrumentation/tilt/prepend.rb
401
404
  - lib/new_relic/agent/instrumentation/typhoeus.rb
402
405
  - lib/new_relic/agent/instrumentation/typhoeus/chain.rb
403
406
  - lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb
@@ -447,7 +450,6 @@ files:
447
450
  - lib/new_relic/agent/stats_engine.rb
448
451
  - lib/new_relic/agent/stats_engine/gc_profiler.rb
449
452
  - lib/new_relic/agent/stats_engine/stats_hash.rb
450
- - lib/new_relic/agent/supported_versions.rb
451
453
  - lib/new_relic/agent/synthetics_event_aggregator.rb
452
454
  - lib/new_relic/agent/system_info.rb
453
455
  - lib/new_relic/agent/threading/agent_thread.rb
@@ -502,7 +504,6 @@ files:
502
504
  - lib/new_relic/control/class_methods.rb
503
505
  - lib/new_relic/control/frameworks.rb
504
506
  - lib/new_relic/control/frameworks/external.rb
505
- - lib/new_relic/control/frameworks/merb.rb
506
507
  - lib/new_relic/control/frameworks/rails.rb
507
508
  - lib/new_relic/control/frameworks/rails3.rb
508
509
  - lib/new_relic/control/frameworks/rails4.rb
@@ -1,53 +0,0 @@
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
- require 'new_relic/agent/datastores/mongo/obfuscator'
6
-
7
- module NewRelic
8
- module Agent
9
- module Datastores
10
- module Mongo
11
- module StatementFormatter
12
-
13
- PLAINTEXT_KEYS = [
14
- :database,
15
- :collection,
16
- :operation,
17
- :fields,
18
- :skip,
19
- :limit,
20
- :order
21
- ]
22
-
23
- OBFUSCATE_KEYS = [
24
- :selector
25
- ]
26
-
27
- def self.format(statement, operation)
28
- return nil unless NewRelic::Agent.config[:'mongo.capture_queries']
29
-
30
- result = { :operation => operation }
31
-
32
- PLAINTEXT_KEYS.each do |key|
33
- result[key] = statement[key] if statement.key?(key)
34
- end
35
-
36
- OBFUSCATE_KEYS.each do |key|
37
- if statement.key?(key) && statement[key]
38
- obfuscated = obfuscate(statement[key])
39
- result[key] = obfuscated if obfuscated
40
- end
41
- end
42
- result
43
- end
44
-
45
- def self.obfuscate(statement)
46
- statement = Obfuscator.obfuscate_statement(statement) if NewRelic::Agent.config[:'mongo.obfuscate_queries']
47
- statement
48
- end
49
- end
50
- end
51
- end
52
- end
53
- end
@@ -1,49 +0,0 @@
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 ::Excon
6
- class Connection
7
- # @connection is deprecated in newer excon versions and replaced with @data
8
- def newrelic_connection_params
9
- (@data || @connection)
10
- end
11
-
12
- def newrelic_resolved_request_params(request_params)
13
- resolved = newrelic_connection_params.merge(request_params)
14
- resolved[:headers] = resolved[:headers].merge(request_params[:headers] || {})
15
- resolved
16
- end
17
-
18
- def request_with_newrelic_trace(params, &block)
19
- resolved_params = newrelic_resolved_request_params(params)
20
- wrapped_request = ::NewRelic::Agent::HTTPClients::ExconHTTPRequest.new(resolved_params)
21
- segment = NewRelic::Agent::Tracer.start_external_request_segment(
22
- library: wrapped_request.type,
23
- uri: wrapped_request.uri,
24
- procedure: wrapped_request.method
25
- )
26
-
27
- begin
28
- response = nil
29
- segment.add_request_headers wrapped_request
30
-
31
- response = NewRelic::Agent::Tracer.capture_segment_error segment do
32
- request_without_newrelic_trace(resolved_params, &block)
33
- end
34
-
35
- wrapped_response = ::NewRelic::Agent::HTTPClients::ExconHTTPResponse.new(response)
36
- segment.process_response_headers wrapped_response
37
-
38
- response
39
- ensure
40
- segment.finish if segment
41
- end
42
- end
43
-
44
- def self.install_newrelic_instrumentation
45
- alias request_without_newrelic_trace request
46
- alias request request_with_newrelic_trace
47
- end
48
- end
49
- end
@@ -1,44 +0,0 @@
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
- require 'set'
6
-
7
- DependencyDetection.defer do
8
- @name = :merb_controller
9
-
10
- depends_on do
11
- defined?(Merb) && defined?(Merb::Controller)
12
- end
13
-
14
- executes do
15
- ::NewRelic::Agent.logger.info 'Installing Merb Controller instrumentation'
16
- end
17
-
18
- executes do
19
- require 'merb-core/controller/merb_controller'
20
-
21
- Merb::Controller.class_eval do
22
- include NewRelic::Agent::Instrumentation::ControllerInstrumentation
23
-
24
- # determine the path that is used in the metric name for
25
- # the called controller action
26
- def newrelic_metric_path
27
- "#{controller_name}/#{action_name}"
28
- end
29
-
30
- protected
31
-
32
- def _dispatch_with_newrelic_trace(*args)
33
- options = {}
34
- options[:params] = params
35
- perform_action_with_newrelic_trace(options) do
36
- _dispatch_without_newrelic_trace(*args)
37
- end
38
- end
39
-
40
- alias_method :_dispatch_without_newrelic_trace, :_dispatch
41
- alias_method :_dispatch, :_dispatch_with_newrelic_trace
42
- end
43
- end
44
- end
@@ -1,33 +0,0 @@
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
- DependencyDetection.defer do
6
- @name = :merb_error
7
-
8
- depends_on do
9
- defined?(Merb) && defined?(Merb::Dispatcher) && defined?(Merb::Dispatcher::DefaultException)
10
- end
11
-
12
- depends_on do
13
- Merb::Dispatcher::DefaultException.respond_to?(:before)
14
- end
15
-
16
- executes do
17
- ::NewRelic::Agent.logger.info 'Installing Merb Errors instrumentation'
18
- end
19
-
20
- executes do
21
-
22
- # Hook in the notification to merb
23
- error_notifier = Proc.new {
24
- if request.exceptions #check that there's actually an exception
25
- # Note, this assumes we have already captured the other information such as uri and params in the Transaction.
26
- NewRelic::Agent::Transaction.notice_error(request.exceptions.first)
27
- end
28
- }
29
- Merb::Dispatcher::DefaultException.before error_notifier
30
- Exceptions.before error_notifier
31
-
32
- end
33
- end
@@ -1,125 +0,0 @@
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
- require 'new_relic/agent/parameter_filtering'
6
-
7
- DependencyDetection.defer do
8
- @name = :rails21_view
9
-
10
- depends_on do
11
- !NewRelic::Agent.config[:disable_view_instrumentation] &&
12
- defined?(ActionController) && defined?(ActionController::Base) && defined?(ActionView::PartialTemplate) && defined?(ActionView::Template) &&
13
- defined?(Rails::VERSION::STRING) && Rails::VERSION::STRING =~ /^2\.1\./ # Rails 2.1 &&
14
- end
15
-
16
- executes do
17
- ::NewRelic::Agent.logger.info 'Installing Rails 2.1 View instrumentation'
18
- end
19
-
20
- executes do
21
- ActionView::PartialTemplate.class_eval do
22
- include NewRelic::Agent::MethodTracer
23
- add_method_tracer :render, 'View/#{path_without_extension[%r{^(/.*/)?(.*)$},2]}.#{@view.template_format}.#{extension}/Partial'
24
- end
25
-
26
- # this is for template rendering, as opposed to partial rendering.
27
- ActionView::Template.class_eval do
28
- include NewRelic::Agent::MethodTracer
29
- add_method_tracer :render, 'View/#{(path_without_extension || @view.controller.newrelic_metric_path)[%r{^(/.*/)?(.*)$},2]}.#{@view.template_format}.#{extension}/Rendering'
30
- end
31
- end
32
- end
33
-
34
- DependencyDetection.defer do
35
- @name = :old_rails_view
36
-
37
- depends_on do
38
- !NewRelic::Agent.config[:disable_view_instrumentation] &&
39
- defined?(ActionController) && defined?(ActionController::Base) &&
40
- defined?(Rails::VERSION::STRING) && Rails::VERSION::STRING =~ /^(1\.|2\.0)/ # Rails 1.* - 2.0
41
- end
42
-
43
- executes do
44
- ::NewRelic::Agent.logger.info 'Installing Rails 1.* - 2.0 View instrumentation'
45
- end
46
-
47
- executes do
48
- ActionController::Base.class_eval do
49
- include NewRelic::Agent::MethodTracer
50
- add_method_tracer :render, 'View/#{newrelic_metric_path}/Rendering'
51
- end
52
- end
53
- end
54
-
55
- DependencyDetection.defer do
56
- @name = :rails23_view
57
-
58
- depends_on do
59
- !NewRelic::Agent.config[:disable_view_instrumentation] &&
60
- defined?(ActionView) && defined?(ActionView::Template) && defined?(ActionView::RenderablePartial) &&
61
- defined?(Rails::VERSION::STRING) && Rails::VERSION::STRING =~ /^2\.[23]/
62
- end
63
-
64
- executes do
65
- ::NewRelic::Agent.logger.info 'Installing Rails 2.2 - 2.3 View instrumentation'
66
- end
67
-
68
- executes do
69
- ActionView::RenderablePartial.module_eval do
70
- include NewRelic::Agent::MethodTracer
71
- add_method_tracer :render_partial, 'View/#{path[%r{^(/.*/)?(.*)$},2]}/Partial'
72
- end
73
-
74
- ActionView::Template.class_eval do
75
- include NewRelic::Agent::MethodTracer
76
- add_method_tracer :render, 'View/#{path[%r{^(/.*/)?(.*)$},2]}/Rendering'
77
- end
78
- end
79
- end
80
-
81
- DependencyDetection.defer do
82
- @name = :rails2_controller
83
-
84
- depends_on do
85
- defined?(ActionController) && defined?(ActionController::Base)
86
- end
87
-
88
- depends_on do
89
- defined?(Rails::VERSION::MAJOR) && Rails::VERSION::MAJOR.to_i == 2
90
- end
91
-
92
- executes do
93
- ::NewRelic::Agent.logger.info 'Installing Rails 2 Controller instrumentation'
94
- end
95
-
96
- executes do
97
- ActionController::Base.class_eval do
98
- include NewRelic::Agent::Instrumentation::ControllerInstrumentation
99
-
100
- def perform_action_with_newrelic_trace_wrapper
101
- munged_params = (respond_to?(:filter_parameters)) ? filter_parameters(params) : params
102
- munged_params = NewRelic::Agent::ParameterFiltering.filter_rails_request_parameters(munged_params)
103
-
104
- perform_action_with_newrelic_trace(:params => munged_params) do
105
- perform_action_without_newrelic_trace
106
- end
107
- end
108
-
109
- alias_method :perform_action_without_newrelic_trace, :perform_action
110
- alias_method :perform_action, :perform_action_with_newrelic_trace_wrapper
111
- private :perform_action
112
-
113
- # determine the path that is used in the metric name for
114
- # the called controller action
115
- def newrelic_metric_path(action_name_override = nil)
116
- action_part = action_name_override || action_name
117
- if action_name_override || self.class.action_methods.include?(action_part)
118
- "#{self.class.controller_path}/#{action_part}"
119
- else
120
- "#{self.class.controller_path}/(other)"
121
- end
122
- end
123
- end
124
- end
125
- end
@@ -1,46 +0,0 @@
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
- DependencyDetection.defer do
6
- @name = :rails_action_web_service
7
-
8
- depends_on do
9
- defined?(ActionWebService)
10
- end
11
-
12
- executes do
13
- ::NewRelic::Agent.logger.info 'Installing Rails ActionWebService instrumentation'
14
- end
15
-
16
- executes do
17
- # NewRelic Agent instrumentation for WebServices
18
-
19
- # Note Action Web Service is removed from default package in rails
20
- # 2.0, this is purely here as a service to our legacy customers.
21
-
22
- # instrumentation for Web Service martialing - XML RPC
23
- ActionWebService::Protocol::XmlRpc::XmlRpcProtocol.class_eval do
24
- add_method_tracer :decode_request, "WebService/Xml Rpc/XML Decode"
25
- add_method_tracer :encode_request, "WebService/Xml Rpc/XML Encode"
26
- add_method_tracer :decode_response, "WebService/Xml Rpc/XML Decode"
27
- add_method_tracer :encode_response, "WebService/Xml Rpc/XML Encode"
28
- end
29
-
30
- # instrumentation for Web Service martialing - Soap
31
- ActionWebService::Protocol::Soap::SoapProtocol.class_eval do
32
- add_method_tracer :decode_request, "WebService/Soap/XML Decode"
33
- add_method_tracer :encode_request, "WebService/Soap/XML Encode"
34
- add_method_tracer :decode_response, "WebService/Soap/XML Decode"
35
- add_method_tracer :encode_response, "WebService/Soap/XML Encode"
36
- end
37
-
38
- if defined?(ActionController) && defined?(ActionController::Base)
39
- ActionController::Base.class_eval do
40
- if method_defined? :perform_invocation
41
- add_method_tracer :perform_invocation, 'WebService/#{controller_name}/#{args.first}'
42
- end
43
- end
44
- end
45
- end
46
- end