newrelic_rpm 8.15.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -28
  3. data/.rubocop_todo.yml +41 -3
  4. data/CHANGELOG.md +191 -38
  5. data/CONTRIBUTING.md +1 -1
  6. data/README.md +3 -1
  7. data/bin/nrdebug +16 -16
  8. data/lib/new_relic/agent/agent_helpers/connect.rb +1 -1
  9. data/lib/new_relic/agent/agent_helpers/special_startup.rb +1 -2
  10. data/lib/new_relic/agent/attribute_filter.rb +0 -2
  11. data/lib/new_relic/agent/commands/thread_profiler_session.rb +3 -3
  12. data/lib/new_relic/agent/configuration/default_source.rb +139 -476
  13. data/lib/new_relic/agent/configuration/high_security_source.rb +0 -2
  14. data/lib/new_relic/agent/configuration/security_policy_source.rb +0 -16
  15. data/lib/new_relic/agent/database.rb +0 -14
  16. data/lib/new_relic/agent/distributed_tracing/cross_app_tracing.rb +1 -2
  17. data/lib/new_relic/agent/error_collector.rb +1 -1
  18. data/lib/new_relic/agent/error_filter.rb +3 -3
  19. data/lib/new_relic/agent/instrumentation/action_cable_subscriber.rb +6 -19
  20. data/lib/new_relic/agent/instrumentation/action_controller_other_subscriber.rb +39 -0
  21. data/lib/new_relic/agent/instrumentation/action_dispatch.rb +31 -0
  22. data/lib/new_relic/agent/instrumentation/action_dispatch_subscriber.rb +64 -0
  23. data/lib/new_relic/agent/instrumentation/action_mailbox.rb +30 -0
  24. data/lib/new_relic/agent/instrumentation/action_mailbox_subscriber.rb +33 -0
  25. data/lib/new_relic/agent/instrumentation/action_mailer.rb +30 -0
  26. data/lib/new_relic/agent/instrumentation/action_mailer_subscriber.rb +85 -0
  27. data/lib/new_relic/agent/instrumentation/action_view_subscriber.rb +7 -7
  28. data/lib/new_relic/agent/instrumentation/active_job.rb +15 -2
  29. data/lib/new_relic/agent/instrumentation/active_job_subscriber.rb +41 -0
  30. data/lib/new_relic/agent/instrumentation/active_storage.rb +4 -0
  31. data/lib/new_relic/agent/instrumentation/active_storage_subscriber.rb +2 -30
  32. data/lib/new_relic/agent/instrumentation/active_support.rb +21 -6
  33. data/lib/new_relic/agent/instrumentation/active_support_subscriber.rb +41 -0
  34. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -1
  35. data/lib/new_relic/agent/instrumentation/custom_events.rb +12 -0
  36. data/lib/new_relic/agent/instrumentation/fiber/chain.rb +20 -0
  37. data/lib/new_relic/agent/instrumentation/fiber/instrumentation.rb +24 -0
  38. data/lib/new_relic/agent/instrumentation/fiber/prepend.rb +18 -0
  39. data/lib/new_relic/agent/instrumentation/fiber.rb +25 -0
  40. data/lib/new_relic/agent/instrumentation/grape.rb +1 -1
  41. data/lib/new_relic/agent/instrumentation/memcache.rb +2 -2
  42. data/lib/new_relic/agent/instrumentation/net_http.rb +1 -1
  43. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +41 -0
  44. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +4 -4
  45. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +13 -1
  46. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +1 -8
  47. data/lib/new_relic/agent/instrumentation/rake.rb +1 -1
  48. data/lib/new_relic/agent/instrumentation/redis.rb +1 -1
  49. data/lib/new_relic/agent/instrumentation/resque.rb +1 -1
  50. data/lib/new_relic/agent/instrumentation/sequel.rb +4 -5
  51. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +3 -7
  52. data/lib/new_relic/agent/monitors/cross_app_monitor.rb +0 -1
  53. data/lib/new_relic/agent/new_relic_service/security_policy_settings.rb +0 -1
  54. data/lib/new_relic/agent/new_relic_service.rb +1 -1
  55. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +0 -1
  56. data/lib/new_relic/agent/samplers/delayed_job_sampler.rb +1 -1
  57. data/lib/new_relic/agent/tracer.rb +10 -1
  58. data/lib/new_relic/agent/transaction/abstract_segment.rb +2 -2
  59. data/lib/new_relic/agent/transaction/tracing.rb +2 -2
  60. data/lib/new_relic/agent/transaction.rb +17 -16
  61. data/lib/new_relic/agent.rb +1 -19
  62. data/lib/new_relic/cli/commands/install.rb +9 -9
  63. data/lib/new_relic/control/instance_methods.rb +1 -1
  64. data/lib/new_relic/local_environment.rb +0 -10
  65. data/lib/new_relic/supportability_helper.rb +0 -1
  66. data/lib/new_relic/version.rb +2 -2
  67. data/lib/newrelic_rpm.rb +1 -1
  68. data/lib/sequel/extensions/{newrelic_instrumentation.rb → new_relic_instrumentation.rb} +3 -3
  69. data/lib/sequel/plugins/{newrelic_instrumentation.rb → new_relic_instrumentation.rb} +3 -3
  70. data/lib/tasks/helpers/format.rb +1 -1
  71. data/lib/tasks/instrumentation_generator/instrumentation.thor +7 -10
  72. data/lib/tasks/instrumentation_generator/templates/Envfile.tt +1 -1
  73. data/newrelic.yml +15 -9
  74. data/newrelic_rpm.gemspec +17 -13
  75. data/test/agent_helper.rb +1 -1
  76. metadata +37 -14
  77. data/lib/new_relic/agent/instrumentation/acts_as_solr.rb +0 -83
  78. data/lib/new_relic/agent/instrumentation/authlogic.rb +0 -33
  79. data/lib/new_relic/agent/instrumentation/data_mapper.rb +0 -215
  80. data/lib/new_relic/agent/instrumentation/rainbows_instrumentation.rb +0 -36
  81. data/lib/new_relic/agent/instrumentation/sunspot.rb +0 -41
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f47710c44016e66769de790e72f361e78671a66d676ce1251bb65fe932dfb617
4
- data.tar.gz: 16886676b0209e4822017475ec470ad11ec20ebb65354a2bd2c022b4d3d3b90e
3
+ metadata.gz: b4283d6fa7224688ad73c78ae5b36f499eb377c96b0511050b588ac2b0884d8e
4
+ data.tar.gz: a10eafed3eaef851da18ba4b4bc8b8c3984f2fd4d7291750be84c418ba942132
5
5
  SHA512:
6
- metadata.gz: f334495833c77703fb5f439617ba4b61c4e07e2138775e510f1c293afa4496ddfe9528582e2cfddcf85e9b04dddfa36dcc58ff110bbd0d05d02aaa2128346633
7
- data.tar.gz: b1eea25ed1b3881d974af3f179cbafc1caf605ffa2941e6a3a4be046aa7afd99643c6865fb0b88ac9817f3e5e630784842502c0aad02af4fcd79418b37eab5fd
6
+ metadata.gz: e680bc7110e8fd9efd9e25ec3559512c74f7f254922a73f80b79cefbef1f5a88d43c6b68cefe4297f64cc430b96e0a561e9980abaa6c7074a51dd8b8f5f13fb0
7
+ data.tar.gz: 0530bc3faa79c4259eee31482bf08adeea08966fead73979f65c7c17f0f33293b905c265a125fd69318f0130c48ae61ab5a4071fa9a1be101c0e47bba2b61abd
data/.rubocop.yml CHANGED
@@ -1081,18 +1081,6 @@ Performance/MapCompact:
1081
1081
  Performance/MethodObjectAsBlock:
1082
1082
  Enabled: false
1083
1083
 
1084
- # TODO: OLD RUBIES - Requires 2.4
1085
- Performance/RegexpMatch:
1086
- Enabled: false
1087
-
1088
- # TODO: OLD RUBIES - Requires 2.4
1089
- Performance/Sum:
1090
- Enabled: false
1091
-
1092
- # TODO: OLD RUBIES - Requires 2.3
1093
- Performance/UnfreezeString:
1094
- Enabled: false
1095
-
1096
1084
  # Disabling for now
1097
1085
  Security/Eval:
1098
1086
  Enabled: false
@@ -1330,11 +1318,6 @@ Style/ExplicitBlockArgument:
1330
1318
  Style/ExponentialNotation:
1331
1319
  Enabled: false
1332
1320
 
1333
- # TODO: MAJOR VERSION - Re-enable FetchEnvVar after dropping support for Ruby 2.2
1334
- # Ruby 2.3+ allows for ENV.fetch('KEY') { default }
1335
- Style/FetchEnvVar:
1336
- Enabled: false
1337
-
1338
1321
  Style/FloatDivision:
1339
1322
  Enabled: false
1340
1323
 
@@ -1470,6 +1453,7 @@ Style/MethodCallWithArgsParentheses:
1470
1453
  - source
1471
1454
  - stub
1472
1455
  - stub_const
1456
+ - use
1473
1457
  AllowedPatterns: [^assert, ^refute]
1474
1458
 
1475
1459
  Style/MethodCallWithoutArgsParentheses:
@@ -1739,17 +1723,6 @@ Style/RescueStandardError:
1739
1723
  Style/ReturnNil:
1740
1724
  Enabled: false
1741
1725
 
1742
- # Can't use, not available in Ruby 2.2
1743
- Style/SafeNavigation:
1744
- Enabled: false
1745
- # ConvertCodeThatCanStartToReturnNil: false
1746
- # AllowedMethods:
1747
- # - present?
1748
- # - blank?
1749
- # - presence
1750
- # - try
1751
- # - try!
1752
-
1753
1726
  Style/Sample:
1754
1727
  Enabled: true
1755
1728
 
data/.rubocop_todo.yml CHANGED
@@ -1,12 +1,12 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-10-03 22:57:47 UTC using RuboCop version 1.36.0.
3
+ # on 2023-02-02 15:27:55 UTC using RuboCop version 1.44.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 412
9
+ # Offense count: 422
10
10
  # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
11
11
  Metrics/AbcSize:
12
12
  Max: 54
@@ -31,7 +31,13 @@ Minitest/DuplicateTestRun:
31
31
  - 'test/multiverse/suites/rails/error_tracing_test.rb'
32
32
  - 'test/multiverse/suites/sinatra/ignoring_test.rb'
33
33
 
34
- # Offense count: 263
34
+ # Offense count: 1
35
+ # This cop supports safe autocorrection (--autocorrect).
36
+ Minitest/EmptyLineBeforeAssertionMethods:
37
+ Exclude:
38
+ - 'test/new_relic/agent_test.rb'
39
+
40
+ # Offense count: 269
35
41
  Minitest/MultipleAssertions:
36
42
  Max: 28
37
43
 
@@ -57,6 +63,38 @@ Minitest/EmptyLineBeforeAssertionMethods:
57
63
  - 'test/new_relic/agent_test.rb'
58
64
  - 'test/new_relic/cli/commands/deployments_test.rb'
59
65
 
66
+ # Offense count: 23
67
+ # This cop supports safe autocorrection (--autocorrect).
68
+ Performance/RegexpMatch:
69
+ Enabled: false
70
+
71
+ # Offense count: 1
72
+ # This cop supports unsafe autocorrection (--autocorrect-all).
73
+ # Configuration parameters: OnlySumOrWithInitialValue.
74
+ Performance/Sum:
75
+ Exclude:
76
+ - 'lib/new_relic/agent/system_info.rb'
77
+
78
+ # Offense count: 72
79
+ # This cop supports unsafe autocorrection (--autocorrect-all).
80
+ Performance/UnfreezeString:
81
+ Enabled: false
82
+
83
+ # Offense count: 21
84
+ # This cop supports safe autocorrection (--autocorrect).
85
+ # Configuration parameters: AllowedVars.
86
+ Style/FetchEnvVar:
87
+ Enabled: false
88
+
89
+ # Offense count: 1
90
+ # This cop supports safe autocorrection (--autocorrect).
60
91
  Style/RedundantStringEscape:
61
92
  Exclude:
62
93
  - 'test/new_relic/agent/logging_test.rb'
94
+
95
+ # Offense count: 115
96
+ # This cop supports unsafe autocorrection (--autocorrect-all).
97
+ # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
98
+ # AllowedMethods: present?, blank?, presence, try, try!
99
+ Style/SafeNavigation:
100
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,159 @@
1
1
  # New Relic Ruby Agent Release Notes
2
2
 
3
+ ## v9.0.0
4
+
5
+ Version 9.0.0 of the agent removes several deprecated configuration options and API methods, enables Thread tracing by default, adds Fiber instrumentation, removes support for Ruby versions 2.2 and 2.3, removes instrumentation for several deprecated gems, changes how the API method `set_transaction_name` works, and updates `rails_defer_initialization` to be an environment variable only configuration option.
6
+
7
+
8
+ - **Remove deprecated configuration options**
9
+
10
+ The following configuration options have been removed and will no longer work. Please update all configs to use the replacements listed below. [PR#1782](https://github.com/newrelic/newrelic-ruby-agent/pull/1782)
11
+
12
+ | Removed | Replacement | `newrelic.yml` example |
13
+ | ----------------------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------- |
14
+ | `analytics_events.capture_attributes` | `transaction_events.attributes.enabled` | `transaction_events.attributes.enabled: false` |
15
+ | `browser_monitoring.capture_attributes` | `browser_monitoring.attributes.enabled` | `browser_monitoring.attributes.enabled: false` |
16
+ | `error_collector.capture_attributes` | `error_collector.attributes.enabled` | `error_collector.attributes.enabled: false` |
17
+ | `resque.capture_params` | `attributes.include` | `attributes.include: ['job.resque.args.*']` |
18
+ | `sidekiq.capture_params` | `attributes.include` | `attributes.include: ['job.sidekiq.args.*']` |
19
+ | `transaction_tracer.capture_attributes` | `transaction_tracer.attributes.enabled` | `transaction_tracer.attributes.enabled: false` |
20
+ | `error_collector.ignore_errors` | `error_collector.ignore_classes` | `error_collector.ignore_classes: ['ActionController::RoutingError', 'CustomError']` |
21
+ | `analytics_events.enabled` | `transaction_events.enabled` | `transaction_events.enabled: false` |
22
+ | `analytics_events.max_samples_stored` | `transaction_events.max_samples_stored` | `transaction_events.max_samples_stored: 1200` |
23
+ | `disable_database_instrumentation` | `disable_sequel_instrumentation` | `disable_sequel_instrumentation: true` |
24
+ | `disable_bunny` | `instrumentation.bunny` | `instrumentation.bunny: disabled` |
25
+ | `disable_curb` | `instrumentation.curb` | `instrumentation.curb: disabled` |
26
+ | `disable_dj` | `instrumentation.delayed_job` | `instrumentation.delayed_job: disabled` |
27
+ | `disable_excon` | `instrumentation.excon` | `instrumentation.excon: disabled` |
28
+ | `disable_grape` | `instrumentation.grape` | `instrumentation.grape: disabled` |
29
+ | `disable_grape_instrumentation` | `instrumentation.grape` | `instrumentation.grape: disabled` |
30
+ | `disable_httpclient` | `instrumentation.httpclient` | `instrumentation.httpcient: disabled` |
31
+ | `disable_httprb` | `instrumentation.httprb` | `instrumentation.httprb: disabled` |
32
+ | `disable_dalli` | `instrumentation.memcache` | `instrumentation.memcache: disabled` |
33
+ | `disable_dalli_cas_client` | `instrumentation.memcache` | `instrumentation.memcache: disabled` |
34
+ | `disable_memcache_client` | `instrumentation.memcache-client` | `instrumentation.memcache-client: disabled` |
35
+ | `disable_memcache_instrumentation` | `instrumentation.memcache` | `instrumentation.memcache: disabled` |
36
+ | `disable_memcached` | `instrumentation.memcached` | `instrumentation.memcached: disabled` |
37
+ | `disable_mongo` | `instrumentation.mongo` | `instrumentation.mongo: disabled` |
38
+ | `disable_net_http` | `instrumentation.net_http` | `instrumentation.net_http: disabled` |
39
+ | `prepend_net_instrumentation` | `instrumentation.net_http` | `instrumentation.net_http: prepend` |
40
+ | `disable_puma_rack` | `instrumentation.puma_rack` | `instrumentation.puma_rack: disabled` |
41
+ | `disable_puma_rack_urlmap` | `instrumentation.puma_rack_urlmap` | `instrumentation.puma_rack_urlmap: disabled` |
42
+ | `disable_rack` | `instrumentation.rack` | `instrumentation.rack: disabled` |
43
+ | `disable_rack_urlmap` | `instrumentation.rack_urlmap` | `instrumentation.rack_urlmap: disabled` |
44
+ | `disable_redis` | `instrumentation.redis` | `instrumentation.redis: disabled` |
45
+ | `disable_redis_instrumentation` | `instrumentation.redis` | `instrumentation.redis: disabled` |
46
+ | `disable_resque` | `instrumentation.resque` | `instrumentation.resque: disabled` |
47
+ | `disable_sinatra` | `instrumentation.sinatra` | `instrumentation.sinatra: disabled` |
48
+ | `disable_rake` | `instrumentation.rake` | `instrumentation.rake: disabled` |
49
+ | `disable_rake_instrumentation` | `instrumentation.rake` | `instrumentation.rake: disabled` |
50
+ | `disable_typhoeus` | `instrumentation.typhoeus` | `instrumentation.typhoeus: disabled` |
51
+
52
+
53
+
54
+
55
+ - **Enable Thread instrumentation by default**
56
+
57
+ The configuration option `instrumentation.thread.tracing` is now enabled by default. This configuration allows the agent to properly monitor code occurring inside threads. In Ruby agent 9.0, instrumented code within threads will be recorded and associated with the current transaction when the thread was created.
58
+
59
+ This may be a breaking change if you are currently using custom thread instrumentation. New transactions inside of threads will no longer be started if one already exists. [PR#1767](https://github.com/newrelic/newrelic-ruby-agent/pull/1767)
60
+
61
+ - **Add Fiber instrumentation**
62
+
63
+ `Fiber` instances are now automatically instrumented similarly to `Thread` instances. This can be [configured](https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration/#instrumentation-fiber) using `instrumentation.fiber`. [PR#1802](https://github.com/newrelic/newrelic-ruby-agent/pull/1802)
64
+
65
+
66
+ - **Removed support for Ruby 2.2 and 2.3**
67
+
68
+ Ruby 2.2 and 2.3 are no longer supported by the Ruby agent. To continue using the latest Ruby Agent version, please update to Ruby 2.4.0 or above. [PR#1778](https://github.com/newrelic/newrelic-ruby-agent/pull/1778)
69
+
70
+ - **Removed deprecated instrumentation**
71
+
72
+ Instrumentation for the following gems had been previously deprecated and has now been removed. [PR#1788](https://github.com/newrelic/newrelic-ruby-agent/pull/1788)
73
+ - Acts As Solr
74
+ - Authlogic
75
+ - DataMapper
76
+ - Rainbows
77
+ - Sunspot
78
+
79
+ Versions of the following technologies had been previously deprecated and are no longer supported.
80
+
81
+ - Passenger: 2.2.x - 4.0.x
82
+ - Puma: 2.0.x
83
+ - Grape: 0.2.0
84
+ - Padrino: 0.14.x
85
+ - Rails: 3.2.x
86
+ - Sinatra: 1.4.x, 1.5.x
87
+ - Mongo: 1.8.x - 2.3.x
88
+ - Sequel: 3.37.x, 4.0.x
89
+ - Delayed_Job: 2.0.x - 4.0.x
90
+ - Sidekiq: 4.2.x
91
+ - Excon: below 0.55.0
92
+ - HttpClient: 2.2.0 - 2.8.0
93
+ - HttpRb: 0.9.9 - 2.2.1
94
+ - Typhoeus: 0.5.3 - 1.2.x
95
+ - Bunny: 2.0.x - 2.6.x
96
+ - ActiveMerchant: 1.25.0 - 1.64.x
97
+
98
+
99
+ - **Updated API method `set_transaction_name`**
100
+
101
+ When the method `NewRelic::Agent.set_transaction_name` is called, it will now always change the name and category of the currently running transaction to what is passed into the method. This is a change from previous agent versions.
102
+
103
+ Previously, if `set_transaction_name` was called with a new transaction name and a new category that did not match the category already assigned to a transaction, neither the new name nor category would be saved to the transaction. If this method is being called in a situation in which it was previously ignored due to category differences, this will now change the name and category of the transaction. [PR#1797](https://github.com/newrelic/newrelic-ruby-agent/pull/1797)
104
+
105
+ - **Removed API method: `NewRelic::Agent.disable_transaction_tracing`**
106
+
107
+ The deprecated API method `NewRelic::Agent.disable_transaction_tracing` has been removed. Instead use either `NewRelic::Agent#ignore_transaction` to disable the recording of the current transaction or `NewRelic::Agent.disable_all_tracing` to yield a block without collecting any metrics or traces in any of the subsequent calls. [PR#1792](https://github.com/newrelic/newrelic-ruby-agent/pull/1792)
108
+
109
+ - **Renamed ActiveJob metrics**
110
+
111
+ Previously, ActiveJob was categorized as a message broker, which is inaccurate. We've updated the naming of ActiveJob traces from leading with `MessageBroker/ActiveJob` to simply leading with `ActiveJob`. [PR#1811](https://github.com/newrelic/newrelic-ruby-agent/pull/1811)
112
+
113
+ - **Code cleanup**
114
+
115
+ Thank you to community member [@esquith](https://github.com/esquith) for contributing some cleanup of orphaned constants in our code base. [PR#1793](https://github.com/newrelic/newrelic-ruby-agent/pull/1793) [PR#1794](https://github.com/newrelic/newrelic-ruby-agent/pull/1794) [PR#1808](https://github.com/newrelic/newrelic-ruby-agent/pull/1808)
116
+
117
+ Community member [@fchatterji](https://github.com/fchatterji) helped standardize how we reference `NewRelic` throughout our codebase [PR#1795](https://github.com/newrelic/newrelic-ruby-agent/pull/1795) and updated our README's community header [PR#1815](https://github.com/newrelic/newrelic-ruby-agent/pull/1815). Thanks fchatterji!
118
+
119
+
120
+ - **Bugfix: Allow rails initialization to be deferred by environment variable**
121
+
122
+ The Ruby agent may force some Rails libraries to load on agent initialization, preventing some settings defined in `config/initializers` from being applied. Changing the initialization process to run after `config/initializers`, however, may break the configuration for other gems (ex. Roadie Rails).
123
+
124
+ For those having troubles with agent initialization and Rails initializers, you can now pass the environment variable `NEW_RELIC_DEFER_RAILS_INITIALIZATION=true` to make the agent initialize after `config/initializers` are run. This config option can only be set using an environment variable and can't be set using YAML. [PR#1791](https://github.com/newrelic/newrelic-ruby-agent/pull/1791)
125
+
126
+ Thanks to [@jdelStrother](https://github.com/jdelStrother) for bringing this issue to our attention and testing our fixes along the way. [Issue#662](https://github.com/newrelic/newrelic-ruby-agent/issues/662)
127
+
128
+
129
+ ## 8.16.0
130
+
131
+ Version 8.16.0 introduces more Ruby on Rails instrumentation (especially for Rails 6 and 7) for various Action\*/Active\* libraries whose actions produce [Active Support notifications events](https://guides.rubyonrails.org/active_support_instrumentation.html).
132
+
133
+ - **Add Various Ruby on Rails Library Instrumentations**
134
+
135
+ New instrumentation is now automatically provided by several Action\*/Active\* libaries that generate Active Support notifications. With each Ruby on Rails release, new the Rails libraries add new events and sometimes existing events have their payload parameters updated as well. The New Relic Ruby agent will now automatically process more of these events and parameters with New Relic segments created for each event. At a minimum, each segment gives timing information for the event. In several cases, all non-sensitive event payload parameters are also passed along in the segment.
136
+
137
+ The agent now newly supports or has updated support for the following libraries:
138
+
139
+ - Action Cable (for WebSockets) [PR#1749](https://github.com/newrelic/newrelic-ruby-agent/pull/1749)
140
+ - Action Controller (for the 'C' in MVC) [PR#1744](https://github.com/newrelic/newrelic-ruby-agent/pull/1744/)
141
+ - Action Mailbox (for sending mail) [PR#1740](https://github.com/newrelic/newrelic-ruby-agent/pull/1740)
142
+ - Action Mailer (for routing mail) [PR#1740](https://github.com/newrelic/newrelic-ruby-agent/pull/1740)
143
+ - Active Job (for background jobs) [PR#1742](https://github.com/newrelic/newrelic-ruby-agent/pull/1761)
144
+ - Active Support (for caching operations) [PR#1742](https://github.com/newrelic/newrelic-ruby-agent/pull/1742)
145
+
146
+ The instrumentations for each of these libaries are all enabled by default, but can be independently disabled via configuration by using the following parameters:
147
+
148
+ | Configuration name | Default | Behavior |
149
+ | --------------------------- | ------- | ------------------------------------------------------ |
150
+ | `disable_action_cable` | `false` | If `true`, disables Action Cable instrumentation. |
151
+ | `disable_action_controller` | `false` | If `true`, disables Action Controller instrumentation. |
152
+ | `disable_action_mailbox` | `false` | If `true`, disables Action Mailbox instrumentation. |
153
+ | `disable_action_mailer` | `false` | If `true`, disables Action Mailer instrumentation. |
154
+ | `disable_activejob` | `false` | If `true`, disables Active Job instrumentation. |
155
+ | `disable_active_support` | `false` | If `true`, disables Active Support instrumentation. |
156
+
3
157
  ## 8.15.0
4
158
 
5
159
  Version 8.15.0 of the agent confirms compatibility with Ruby 3.2.0, adds instrumentation for concurrent-ruby, and confirms Sinatra 3 compatibility with Padrino 0.15.2. It also enables batching and compression for Infinite Tracing.
@@ -12,18 +166,18 @@ Version 8.15.0 of the agent confirms compatibility with Ruby 3.2.0, adds instrum
12
166
 
13
167
  Instrumentation for the [concurrent-ruby](https://github.com/ruby-concurrency/concurrent-ruby) gem has been added to the agent for versions 1.1.5 and above. When a transaction is already in progress and a call to a `Concurrent::` method that routes through `Concurrent::ThreadPoolExecutor#post` is made, a segment will be added to the transaction. Any content within the block passed to the `Concurrent::` method that is instrumented by the agent, such as a call to `Net::HTTP.get`, will have a nested segment created. [PR#1682](https://github.com/newrelic/newrelic-ruby-agent/pull/1682)
14
168
 
15
- | Configuration name | Default | Behavior |
16
- | --------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
169
+ | Configuration name | Default | Behavior |
170
+ | --------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------- |
17
171
  | `instrumentation.concurrent_ruby` | auto | Controls auto-instrumentation of the concurrent-ruby library at start up. May be one of `auto`, `prepend`, `chain`, `disabled`. |
18
172
 
19
173
  - **Infinite Tracing: Use batching and compression**
20
174
 
21
175
  For [Infinite Tracing](https://docs.newrelic.com/docs/distributed-tracing/infinite-tracing/introduction-infinite-tracing/), which Ruby applications can leverage with the `newrelic-infinite_tracing` gem, payloads will now be batched and compressed to signficantly decrease the amount of outbound network traffic. [PR#1723](https://github.com/newrelic/newrelic-ruby-agent/pull/1723)
22
176
 
23
- | Configuration name | Default | Behavior |
24
- | --------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
25
- | `infinite_tracing.batching` | true | If true (the default), data sent to the Trace Observer will be batched instead of each span being sent individually |
26
- | `infinite_tracing.compression_level` | high | Configure the compression level for data sent to the Trace Observer. May be one of [none|low|medium|high]. 'high' is the default. Set the level to 'none' to disable compression. |
177
+ | Configuration name | Default | Behavior |
178
+ | ------------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------- | --- | ------ | ----------------------------------------------------------------------------- |
179
+ | `infinite_tracing.batching` | true | If true (the default), data sent to the Trace Observer will be batched instead of each span being sent individually |
180
+ | `infinite_tracing.compression_level` | high | Configure the compression level for data sent to the Trace Observer. May be one of [none | low | medium | high]. 'high' is the default. Set the level to 'none' to disable compression. |
27
181
 
28
182
  - **Add Support for Padrino 0.15.2 and Sinatra 3**
29
183
 
@@ -294,36 +448,35 @@ Version 8.11.0 of the agent updates the `newrelic deployments` command to work w
294
448
 
295
449
  - **Deprecate instrumentation versions with low adoption and/or versions over five years old**
296
450
 
297
-
298
- This release deprecates the following instrumentation:
299
- | Deprecated | Replacement |
300
- | ----------- | ----------- |
301
- | ActiveMerchant < 1.65.0 | ActiveMerchant >= 1.65.0 |
302
- | Acts As Solr (all versions) | none |
303
- | Authlogic (all versions) | none |
304
- | Bunny < 2.7.0 | bunny >= 2.7.0 |
305
- | Dalli < 3.2.1 | Dalli >= 3.2.1 |
306
- | DataMapper (all versions) | none |
307
- | Delayed Job < 4.1.0 | Delayed Job >= 4.1.0 |
308
- | Excon < 0.56.0 | Excon >= 0.56.0 |
309
- | Grape < 0.19.2 | Grape >= 0.19.2 |
310
- | HTTPClient < 2.8.3 | HTTPClient 2.8.3 |
311
- | HTTP.rb < 2.2.2 | HTTP.rb >= 2.2.2 |
312
- | Mongo < 2.4.1 | Mongo >= 2.4.1 |
313
- | Padrino < 0.15.0 | Padrino >= 0.15.0 |
314
- | Passenger < 5.1.3 | Passenger >= 5.1.3 |
315
- | Puma < 3.9.0 | Puma >= 3.9.0 |
316
- | Rack < 1.6.8 | Rack >= 1.6.8 |
317
- | Rails 3.2.x | Rails >= 4.x |
318
- | Rainbows (all versions) | none |
319
- | Sequel < 4.45.0 | Sequel >= 4.45.0 |
320
- | Sidekiq < 5.0.0 | Sidekiq >= 5.0.0 |
321
- | Sinatra < 2.0.0 | Sinatra >= 2.0.0 |
322
- | Sunspot (all versions) | none |
323
- | Typhoeus < 1.3.0 | Typhoeus >= 1.3.0 |
324
- | Unicorn < 5.3.0 | Unicorn >= 5.3.0 |
325
-
326
- For the gems with deprecated versions, we will no longer test those versions in our multiverse suite. They may, however, still be compatible with the agent. We will no longer fix bug reports for issues related to these gem versions.
451
+ This release deprecates the following instrumentation:
452
+ | Deprecated | Replacement |
453
+ | ----------- | ----------- |
454
+ | ActiveMerchant < 1.65.0 | ActiveMerchant >= 1.65.0 |
455
+ | Acts As Solr (all versions) | none |
456
+ | Authlogic (all versions) | none |
457
+ | Bunny < 2.7.0 | bunny >= 2.7.0 |
458
+ | Dalli < 3.2.1 | Dalli >= 3.2.1 |
459
+ | DataMapper (all versions) | none |
460
+ | Delayed Job < 4.1.0 | Delayed Job >= 4.1.0 |
461
+ | Excon < 0.56.0 | Excon >= 0.56.0 |
462
+ | Grape < 0.19.2 | Grape >= 0.19.2 |
463
+ | HTTPClient < 2.8.3 | HTTPClient 2.8.3 |
464
+ | HTTP.rb < 2.2.2 | HTTP.rb >= 2.2.2 |
465
+ | Mongo < 2.4.1 | Mongo >= 2.4.1 |
466
+ | Padrino < 0.15.0 | Padrino >= 0.15.0 |
467
+ | Passenger < 5.1.3 | Passenger >= 5.1.3 |
468
+ | Puma < 3.9.0 | Puma >= 3.9.0 |
469
+ | Rack < 1.6.8 | Rack >= 1.6.8 |
470
+ | Rails 3.2.x | Rails >= 4.x |
471
+ | Rainbows (all versions) | none |
472
+ | Sequel < 4.45.0 | Sequel >= 4.45.0 |
473
+ | Sidekiq < 5.0.0 | Sidekiq >= 5.0.0 |
474
+ | Sinatra < 2.0.0 | Sinatra >= 2.0.0 |
475
+ | Sunspot (all versions) | none |
476
+ | Typhoeus < 1.3.0 | Typhoeus >= 1.3.0 |
477
+ | Unicorn < 5.3.0 | Unicorn >= 5.3.0 |
478
+
479
+ For the gems with deprecated versions, we will no longer test those versions in our multiverse suite. They may, however, still be compatible with the agent. We will no longer fix bug reports for issues related to these gem versions.
327
480
 
328
481
  - **Clarify documentation for `rake.tasks` configuration**
329
482
 
@@ -3157,7 +3310,7 @@ reported to New Relic. The second ignores only the Apdex metric for a single
3157
3310
  transaction. The third disables javascript injection for browser monitoring
3158
3311
  for the current transaction.
3159
3312
 
3160
- These methods differ from the existing newrelic*ignore** method in that they
3313
+ These methods differ from the existing newrelic*ignore\*\* method in that they
3161
3314
  may be called *during\* a transaction based on some dynamic runtime criteria,
3162
3315
  as opposed to at the class level on startup.
3163
3316
 
@@ -3254,7 +3407,7 @@ traces from in the Transaction Trace drill-down.
3254
3407
  - High security mode V2
3255
3408
 
3256
3409
  The Ruby agent now supports V2 of New Relic's high security mode. To enable
3257
- it, you must add 'high_security: true' to your newrelic.yml file, _and_ enable
3410
+ it, you must add 'high\_security: true' to your newrelic.yml file, _and_ enable
3258
3411
  high security mode through the New Relic web interface. The local agent
3259
3412
  setting must be in agreement with the server-side setting, or the agent will
3260
3413
  shut down and no data will be collected.
data/CONTRIBUTING.md CHANGED
@@ -94,7 +94,7 @@ includes unreleased work. Please create all new branches off of `dev`.
94
94
  - Fork the repository inside GitHub
95
95
  - `git clone git@github.com:<gh username>/newrelic-ruby-agent.git`
96
96
  1. Pick a Ruby version
97
- - Use rbenv, rvm, chruby, asdf, etc. to install any version of Ruby between 2.2 up to the latest stable version
97
+ - Use rbenv, rvm, chruby, asdf, etc. to install any version of Ruby between 2.4 up to the latest stable version
98
98
  1. Install development dependencies
99
99
  - `bundle install`
100
100
  1. Check that your env is setup correctly
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Open Source, New Relic Community Plus: This code is currently maintained by New Relic engineering teams and delivered here in GitHub. See the README for troubleshooting and defect reporting instructions.](https://github.com/newrelic/open-source-office/raw/master/examples/categories/images/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)
1
+ [![Community Plus header](https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Community_Plus.png)](https://opensource.newrelic.com/oss-category/#community-plus)
2
2
 
3
3
 
4
4
  # New Relic Ruby Agent
@@ -12,6 +12,8 @@ to help you improve the customer experience and make data-driven business decisi
12
12
  The New Relic Ruby agent is dual-purposed as either a Gem or a Rails plugin,
13
13
  hosted on [github](https://github.com/newrelic/newrelic-ruby-agent).
14
14
 
15
+ This code is actively maintained by New Relic engineering teams and delivered here in GitHub. See below for troubleshooting and defect reporting instructions.
16
+
15
17
  [![Gem Version](https://badge.fury.io/rb/newrelic_rpm.svg)](https://badge.fury.io/rb/newrelic_rpm)
16
18
 
17
19
  ## Supported Environments
data/bin/nrdebug CHANGED
@@ -155,7 +155,7 @@ class RubyProcess
155
155
  def gdb_script_body(backtrace_file)
156
156
  backtrace_gathering_code = 'Thread.list.each { |t| bt = t.backtrace rescue nil; ' \
157
157
  'puts \"#{t.inspect}\n#{bt && bt.join(\"\n\")}\n\n\" }'
158
- <<-END
158
+ <<~END
159
159
  attach #{pid}
160
160
  t a a bt
161
161
  call (void)close(1)
@@ -247,21 +247,21 @@ class ProcessReport
247
247
  end
248
248
 
249
249
  def prompt_for_confirmation(target_pid, target_cmd)
250
- puts <<-PROMPT
251
- Are you sure you want to attach to PID #{target_pid} ('#{target_cmd}')}?
252
-
253
- ************************** !WARNING! **************************
254
- Extracting debug information from this process may cause it to CRASH OR HANG.
255
-
256
- It is highly recommended that you only run this script against processes that
257
- are already unresponsive.
258
-
259
- Additionally, the output may contain sensitive information from the program's
260
- command line arguments, environment, or open file list. Please examine the
261
- output before sharing it.
262
- ************************** !WARNING! **************************
263
-
264
- To continue, type 'continue':
250
+ puts <<~PROMPT
251
+ Are you sure you want to attach to PID #{target_pid} ('#{target_cmd}')}?
252
+
253
+ ************************** !WARNING! **************************
254
+ Extracting debug information from this process may cause it to CRASH OR HANG.
255
+
256
+ It is highly recommended that you only run this script against processes that
257
+ are already unresponsive.
258
+
259
+ Additionally, the output may contain sensitive information from the program's
260
+ command line arguments, environment, or open file list. Please examine the
261
+ output before sharing it.
262
+ ************************** !WARNING! **************************
263
+
264
+ To continue, type 'continue':
265
265
  PROMPT
266
266
 
267
267
  until $stdin.gets.strip == 'continue'
@@ -162,7 +162,7 @@ module NewRelic
162
162
 
163
163
  def connect_options(options)
164
164
  {
165
- keep_retrying: Agent.config[:keep_retrying],
165
+ keep_retrying: true,
166
166
  force_reconnect: Agent.config[:force_reconnect]
167
167
  }.merge(options)
168
168
  end
@@ -10,8 +10,7 @@ module NewRelic
10
10
  # requests, we need to wait until the children are forked
11
11
  # before connecting, otherwise the parent process sends useless data
12
12
  def using_forking_dispatcher?
13
- # TODO: MAJOR VERSION - remove :rainbows
14
- if [:puma, :passenger, :rainbows, :unicorn].include?(Agent.config[:dispatcher])
13
+ if [:puma, :passenger, :unicorn].include?(Agent.config[:dispatcher])
15
14
  ::NewRelic::Agent.logger.info("Deferring startup of agent reporting thread because " \
16
15
  "#{Agent.config[:dispatcher]} may fork.")
17
16
  true
@@ -124,8 +124,6 @@ module NewRelic
124
124
 
125
125
  def prep_capture_params_rules(config)
126
126
  build_rule(['request.parameters.*'], include_destinations_for_capture_params(config[:capture_params]), true)
127
- build_rule(['job.resque.args.*'], include_destinations_for_capture_params(config[:'resque.capture_params']), true)
128
- build_rule(['job.sidekiq.args.*'], include_destinations_for_capture_params(config[:'sidekiq.capture_params']), true)
129
127
  end
130
128
 
131
129
  def prep_datastore_rules(config)
@@ -89,9 +89,9 @@ module NewRelic
89
89
  end
90
90
 
91
91
  def raise_unsupported_error
92
- msg = <<-EOF
93
- Thread profiling is not supported for Resque processes. If you did not intend to
94
- profile a Resque process, profiling again might select an appropriate agent.
92
+ msg = <<~EOF
93
+ Thread profiling is not supported for Resque processes. If you did not intend to
94
+ profile a Resque process, profiling again might select an appropriate agent.
95
95
  EOF
96
96
  raise_command_error(msg)
97
97
  end