newrelic_rpm 9.2.2 → 9.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.build_ignore +26 -0
  3. data/CHANGELOG.md +70 -0
  4. data/README.md +4 -4
  5. data/lib/new_relic/agent/configuration/default_source.rb +77 -29
  6. data/lib/new_relic/agent/configuration/manager.rb +3 -2
  7. data/lib/new_relic/agent/configuration/yaml_source.rb +13 -0
  8. data/lib/new_relic/agent/distributed_tracing.rb +1 -1
  9. data/lib/new_relic/agent/instrumentation/active_record.rb +1 -1
  10. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +2 -1
  11. data/lib/new_relic/agent/instrumentation/concurrent_ruby/chain.rb +1 -1
  12. data/lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb +1 -2
  13. data/lib/new_relic/agent/instrumentation/concurrent_ruby/prepend.rb +1 -1
  14. data/lib/new_relic/agent/instrumentation/fiber/chain.rb +10 -3
  15. data/lib/new_relic/agent/instrumentation/fiber/instrumentation.rb +1 -2
  16. data/lib/new_relic/agent/instrumentation/fiber/prepend.rb +10 -3
  17. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +3 -3
  18. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +1 -1
  19. data/lib/new_relic/agent/instrumentation/thread/chain.rb +1 -1
  20. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +0 -1
  21. data/lib/new_relic/agent/instrumentation/thread/prepend.rb +1 -1
  22. data/lib/new_relic/agent/log_event_aggregator.rb +49 -2
  23. data/lib/new_relic/agent/log_event_attributes.rb +115 -0
  24. data/lib/new_relic/agent/logging.rb +4 -4
  25. data/lib/new_relic/agent/method_tracer_helpers.rb +26 -5
  26. data/lib/new_relic/agent/tracer.rb +2 -2
  27. data/lib/new_relic/agent.rb +38 -1
  28. data/lib/new_relic/cli/command.rb +1 -0
  29. data/lib/new_relic/dependency_detection.rb +6 -0
  30. data/lib/new_relic/latest_changes.rb +1 -1
  31. data/lib/new_relic/rack/browser_monitoring.rb +1 -1
  32. data/lib/new_relic/supportability_helper.rb +1 -0
  33. data/lib/new_relic/traced_thread.rb +2 -3
  34. data/lib/new_relic/version.rb +2 -2
  35. data/lib/sequel/extensions/new_relic_instrumentation.rb +1 -1
  36. data/lib/tasks/bump_version.rake +21 -0
  37. data/lib/tasks/helpers/newrelicyml.rb +144 -0
  38. data/lib/tasks/helpers/version_bump.rb +62 -0
  39. data/lib/tasks/newrelicyml.rake +13 -0
  40. data/newrelic.yml +307 -266
  41. data/newrelic_rpm.gemspec +10 -7
  42. metadata +13 -25
  43. data/.gitignore +0 -43
  44. data/.project +0 -23
  45. data/.rubocop.yml +0 -1845
  46. data/.rubocop_todo.yml +0 -61
  47. data/.simplecov +0 -16
  48. data/.snyk +0 -11
  49. data/.yardopts +0 -27
  50. data/Brewfile +0 -13
  51. data/DOCKER.md +0 -167
  52. data/Dockerfile +0 -10
  53. data/Guardfile +0 -27
  54. data/config/database.yml +0 -5
  55. data/config.dot +0 -278
  56. data/docker-compose.yml +0 -107
  57. data/lefthook.yml +0 -9
  58. data/lib/tasks/helpers/removers.rb +0 -33
  59. data/lib/tasks/multiverse.rake +0 -6
  60. data/lib/tasks/multiverse.rb +0 -84
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd188401ae5aad975a09ff40578156c88aac17e12320f41ce4bee8149c769aaf
4
- data.tar.gz: e32201ee58712dd1520f03ae23a46bd1c804c2991b835151a68643c00cf140e3
3
+ metadata.gz: a1208297462f0c1fa6193688659b805394587801a45b08dd7405f6189bc8c195
4
+ data.tar.gz: b0dbfa4168393aa4a86572f693f591a7bd356b59b6ba2c4852c991f7ca6cfd97
5
5
  SHA512:
6
- metadata.gz: cf9190f9bece2103511dc53071120f3dc758dba82cf042c1892d3376dc73a7b66e8898908bfe8406d85ba49ad67f7c6f5b2826e8e9b2a07d29ea05f5a99b701c
7
- data.tar.gz: 5a240785708c245119750b33df64e5467e7f9b8abf9daae8b568a452da1913f40862788323232928ecc6da489fc7b998118f2397293a55e4d371e3f0a1ae0ad5
6
+ metadata.gz: 900feb5ed5bb4b15c526e3149bb4324c50c0a3aeff51cdb4820ba985459fb87e6f4f1e4dad0c35715a445a0a533e58655ecb0be6bf51e5051eb290ff39c5d5aa
7
+ data.tar.gz: 748f6043761bfa4e86555fe24b82db22498426959e99dacf56ae7a9d27a1bb8afc759ce9f0720b226054369b9a45a01318f14326ece5bb5ddb0176c18c6c9c6b
data/.build_ignore ADDED
@@ -0,0 +1,26 @@
1
+ .github/
2
+ .gitignore
3
+ .project
4
+ .rubocop.yml
5
+ .rubocop_todo.yml
6
+ .simplecov
7
+ .snyk
8
+ .yardopts
9
+ Brewfile
10
+ CONTRIBUTING.md
11
+ Dockerfile
12
+ DOCKER.md
13
+ docker-compose.yml
14
+ config/
15
+ config.dot
16
+ infinite_tracing/
17
+ Guardfile
18
+ lefthook.yml
19
+ log/
20
+ README.md
21
+ test/
22
+ lib/tasks/bump_version.rb
23
+ lib/tasks/coverage_report.rb
24
+ lib/tasks/multiverse.rake
25
+ lib/tasks/multiverse.rb
26
+ lib/tasks/tests.rb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # New Relic Ruby Agent Release Notes
2
2
 
3
+ ## v9.3.1
4
+
5
+ Version 9.3.1 of the agent fixes `NewRelic::Agent.require_test_helper`.
6
+
7
+ - **Bugfix: Fix NewRelic::Agent.require_test_helper**
8
+
9
+ Version 9.3.0 of the agent made a change to the files distributed with the gem. This change unintentionally broke the `NewRelic::Agent.require_test_helper` API by removing the `test/agent_helper.rb` file. The file has been added back to the gem. This change also removes the `lib/new_relic/build.rb` file from the list because it is no longer created with our current release process.
10
+
11
+ Our thanks go to [@ajesler](https://github.com/ajesler) for reporting this issue and writing a test for the bug. [Issue#2113](https://github.com/newrelic/newrelic-ruby-agent/issues/2113), [PR#2115](https://github.com/newrelic/newrelic-ruby-agent/pull/2115), [Issue#2117](https://github.com/newrelic/newrelic-ruby-agent/issues/2117), [PR#2118](https://github.com/newrelic/newrelic-ruby-agent/pull/2118)
12
+
13
+ - **Source Documentation: update the Rack spec URL**
14
+
15
+ Community member [@olleolleolle](https://github.com/olleolleolle) noticed that our source code was referencing a now defunct URL for the Rack specification and submitted [PR#2121](https://github.com/newrelic/newrelic-ruby-agent/pull/2121) to update it. He also provided a terrific recommendation that we automate the checking of links to proactively catch defunct ones in future. Thanks, @olleolleolle!
16
+
17
+
18
+ ## v9.3.0
19
+
20
+ Version 9.3.0 of the agent adds log-level filtering, adds custom attributes for log events, and updates instrumentation for Action Cable. It also provides fixes for how `Fiber` args are treated, Code-Level Metrics, unnecessary files being included in the gem, and `NewRelic::Agent::Logging::DecoratingFormatter#clear_tags!` being incorrectly private.
21
+
22
+ - **Feature: Filter forwarded logs based on level**
23
+
24
+ Previously, all log events, regardless of their level, were forwarded to New Relic when log forwarding was enabled. Now, you may specify the lowest log level you'd like forwarded to New Relic.
25
+
26
+ | Configuration name | Default | Behavior | Valid values |
27
+ | --------------------------- | ------- | ------------------------------------------------------ | ------ |
28
+ | `application_logging.forwarding.log_level` | `debug` | Sets the minimum log level for events forwarded to New Relic | `debug`, `info`, `warn`, `error`, `fatal`, `unknown` |
29
+
30
+ This setting uses [Ruby's Logger::Severity constants integer values](https://github.com/ruby/ruby/blob/master/lib/logger/severity.rb#L6-L17) to determine precedence.
31
+
32
+ - **Feature: Custom attributes for logs**
33
+
34
+ You can now add custom attributes to log events forwarded to New Relic! You can pass these attributes using an API and/or a configuration option.
35
+
36
+ | Configuration name | Default | Behavior |
37
+ | --------------------------- | ------- | ------------------------------------------------------ |
38
+ | `application_logging.forwarding.custom_attributes` | `{}` | A hash with key/value pairs to add as custom attributes to all log events forwarded to New Relic. If sending using an environment variable, the value must be formatted like: "key1=value1,key2=value2" |
39
+
40
+
41
+ Call the API using `NewRelic::Agent.add_custom_log_attributes` and passing your attributes as a hash. For example, you could call: `NewRelic::Agent.add_custom_log_attributes(dyno: ENV['DYNO'], pod_name: ENV['POD_NAME'])`, to add the attributes `dyno` and `pod_name` to your log events.
42
+
43
+ Attributes passed to the API or the configuration will be added to all log events.
44
+
45
+ Thanks to [@rajpawar02](https://github.com/rajpawar02) for raising this issue and [@askreet](https://github.com/askreet) for helping us with the solution. [Issue#1141](https://github.com/newrelic/newrelic-ruby-agent/issues/1141), [PR#2084](https://github.com/newrelic/newrelic-ruby-agent/pull/2084), [PR#2087](https://github.com/newrelic/newrelic-ruby-agent/pull/2087)
46
+
47
+ - **Feature: Instrument transmit_subscription-related Action Cable actions**
48
+
49
+ This change subscribes the agent to the Active Support notifications for:
50
+ * `transmit_subscription_confirmation.action_cable`
51
+ * `transmit_subscription_rejection.action_cable`
52
+
53
+ - **Bugfix: Removed unwanted files from being included in file_list in gemspec**
54
+
55
+ Previously, the agent was including some files in the gem that were not needed but added to the size of the gem. These files will no longer be included. Thanks to [@manuraj17](https://github.com/manuraj17) for the contribution! [PR#2089](https://github.com/newrelic/newrelic-ruby-agent/pull/2089)
56
+
57
+ - **Bugfix: Report Code-Level Metrics for Rails controller methods**
58
+
59
+ Controllers in Rails automatically render views with names that correspond to valid routes. This means that a controller method may not have a corresponding method in the controller class. Code-Level Metrics now report on these methods and don't log false warnings. Thanks to [@jcrisp](https://github.com/jcrisp) for reporting this issue. [PR#2061](https://github.com/newrelic/newrelic-ruby-agent/pull/2061)
60
+
61
+ - **Bugfix: Code-Level Metrics for ActiveRecord models**
62
+
63
+ Classes that inherit from ActiveRecord were not reporting Code-Level Metrics due to an error in the agent when identifying the class name. This has been fixed and Code-Level Metrics will now report for ActiveRecord models. Thanks to [@abigail-rolling](https://github.com/abigail-rolling) for reporting this issue. [PR#2092](https://github.com/newrelic/newrelic-ruby-agent/pull/2092).
64
+
65
+ - **Bugfix: Private method `clear_tags!` for NewRelic::Agent::Logging::DecoratingFormatter**
66
+
67
+ As part of a refactor included in a previous release of the agent, the method `NewRelic::Agent::Logging::DecoratingFormatter#clear_tags!` was incorrectly made private. This method is now public again. Thanks to [@dark-panda](https://github.com/dark-panda) for reporting this issue. [PR#](https://github.com/newrelic/newrelic-ruby-agent/pull/2078)
68
+
69
+ - **Bugfix: Fix the way args are handled for Fibers**
70
+
71
+ Previously, the agent treated Fiber args the same as it was treating Thread args, which is not correct. Args are passed to `Fiber#resume`, and not `Fiber.new`. This has been fixed, and the agent will properly preserve args for both Fiber and Thread classes. This also caused an error to occur when using Async 2.6.2, due to mismatching initalize definitions for Fiber prepended modules. This has been fixed as well. Thanks to [@travisbell](https://github.com/travisbell) for bringing this to our attention. [PR#2083](https://github.com/newrelic/newrelic-ruby-agent/pull/2083)
72
+
3
73
  ## v9.2.2
4
74
 
5
75
  Version 9.2.2 of the agent fixes a bug with the `Transaction#finished?` method.
data/README.md CHANGED
@@ -9,7 +9,7 @@ You can also extend the agent's performance monitoring to
9
9
  to help you improve the customer experience and make data-driven business decisions.
10
10
 
11
11
  The New Relic Ruby agent is dual-purposed as either a Gem or a Rails plugin,
12
- hosted on [github](https://github.com/newrelic/newrelic-ruby-agent).
12
+ hosted on [GitHub](https://github.com/newrelic/newrelic-ruby-agent).
13
13
 
14
14
  This code is actively maintained by New Relic engineering teams and delivered here in GitHub. See below for troubleshooting and defect reporting instructions.
15
15
 
@@ -25,7 +25,7 @@ Environments" section below.
25
25
 
26
26
  ## Installing and Using
27
27
 
28
- The latest released gem for the Ruby agent can be found at [Rubygems.org](https://rubygems.org/gems/newrelic_rpm)
28
+ The latest released gem for the Ruby agent can be found at [RubyGems.org](https://rubygems.org/gems/newrelic_rpm)
29
29
 
30
30
  ### Quick Start
31
31
 
@@ -88,7 +88,7 @@ for more information.
88
88
 
89
89
  Should you need assistance with New Relic products, you are in good hands with several support diagnostic tools and support channels.
90
90
 
91
- This [troubleshooting framework](https://discuss.newrelic.com/t/ruby-troubleshooting-framework-install/108685) steps you through common troubleshooting questions.
91
+ This [troubleshooting framework](https://forum.newrelic.com/s/hubtopic/aAX8W0000008bSgWAI/ruby-troubleshooting-framework-install) steps you through common troubleshooting questions.
92
92
 
93
93
  New Relic offers NRDiag, [a client-side diagnostic utility](https://docs.newrelic.com/docs/using-new-relic/cross-product-functions/troubleshooting/new-relic-diagnostics) that automatically detects common problems with New Relic agents. If NRDiag detects a problem, it suggests troubleshooting steps. NRDiag can also automatically attach troubleshooting data to a New Relic Support ticket.
94
94
 
@@ -97,7 +97,7 @@ If the issue has been confirmed as a bug or is a Feature request, please file a
97
97
  **Support Channels**
98
98
 
99
99
  * [New Relic Documentation](https://docs.newrelic.com/docs/agents/ruby-agent): Comprehensive guidance for using our platform
100
- * [New Relic Community](https://discuss.newrelic.com/tags/rubyagent): The best place to engage in troubleshooting questions
100
+ * [New Relic Community](https://forum.newrelic.com): The best place to engage in troubleshooting questions
101
101
  * [New Relic Developer](https://developer.newrelic.com/): Resources for building a custom observability applications
102
102
  * [New Relic University](https://learn.newrelic.com/): A range of online training for New Relic users of every level
103
103
  * [New Relic Technical Support](https://support.newrelic.com/) 24/7/365 ticketed support. Read more about our [Technical Support Offerings](https://docs.newrelic.com/docs/licenses/license-information/general-usage-licenses/support-plan).
@@ -211,6 +211,22 @@ module NewRelic
211
211
  end
212
212
  end
213
213
 
214
+ def self.convert_to_hash(value)
215
+ return value if value.is_a?(Hash)
216
+
217
+ if value.is_a?(String)
218
+ return value.split(',').each_with_object({}) do |item, hash|
219
+ key, value = item.split('=')
220
+ hash[key] = value
221
+ end
222
+ end
223
+
224
+ raise ArgumentError.new(
225
+ "Config value '#{value}' of " \
226
+ "class #{value.class} couldn't be turned into a Hash."
227
+ )
228
+ end
229
+
214
230
  SEMICOLON = ';'.freeze
215
231
  def self.convert_to_list_on_semicolon(value)
216
232
  case value
@@ -427,7 +443,7 @@ module NewRelic
427
443
  'Known use-case for this option is where Sinatra is running as an embedded service within another framework ' \
428
444
  'and the agent is detecting the Sinatra app and skipping the `at_exit` handler as a result. Sinatra classically ' \
429
445
  'runs the entire application in an `at_exit` block and would otherwise misbehave if the Agent\'s `at_exit` handler ' \
430
- 'was also installed in those circumstances. Note: `send_data_on_exit` should also be set to `true` in tandem with this setting.'
446
+ 'was also installed in those circumstances. Note: `send_data_on_exit` should also be set to `true` in tandem with this setting.'
431
447
  },
432
448
  :high_security => {
433
449
  :default => false,
@@ -588,8 +604,7 @@ module NewRelic
588
604
 
589
605
  - If you do not want the agent to capture query information, set this to `none`.
590
606
  - If you want the agent to capture all query information in its original form, set this to `raw`.
591
- - When you enable [high security mode](/docs/agents/manage-apm-agents/configuration/high-security-mode), this is automatically set to `obfuscated`.
592
- '
607
+ - When you enable [high security mode](/docs/agents/manage-apm-agents/configuration/high-security-mode), this is automatically set to `obfuscated`.'
593
608
  },
594
609
 
595
610
  :'transaction_tracer.stack_trace_threshold' => {
@@ -749,6 +764,37 @@ module NewRelic
749
764
  :allowed_from_server => false,
750
765
  :description => 'If `true`, the agent captures log records emitted by your application.'
751
766
  },
767
+ :'application_logging.forwarding.log_level' => {
768
+ :default => 'debug',
769
+ :public => true,
770
+ :type => String,
771
+ :allowed_from_server => false,
772
+ :description => <<~DESCRIPTION
773
+ Sets the minimum level a log event must have to be forwarded to New Relic.
774
+
775
+ This is based on the integer values of Ruby's `Logger::Severity` constants: https://github.com/ruby/ruby/blob/master/lib/logger/severity.rb
776
+
777
+ The intention is to forward logs with the level given to the configuration, as well as any logs with a higher level of severity.
778
+
779
+ For example, setting this value to "debug" will forward all log events to New Relic. Setting this value to "error" will only forward log events with the levels "error", "fatal", and "unknown".
780
+
781
+ Valid values (ordered lowest to highest):
782
+ * "debug"
783
+ * "info"
784
+ * "warn"
785
+ * "error"
786
+ * "fatal"
787
+ * "unknown"
788
+ DESCRIPTION
789
+ },
790
+ :'application_logging.forwarding.custom_attributes' => {
791
+ :default => {},
792
+ :public => true,
793
+ :type => Hash,
794
+ :transform => DefaultSource.method(:convert_to_hash),
795
+ :allowed_from_server => false,
796
+ :description => 'A hash with key/value pairs to add as custom attributes to all log events forwarded to New Relic. If sending using an environment variable, the value must be formatted like: "key1=value1,key2=value2"'
797
+ },
752
798
  :'application_logging.forwarding.max_samples_stored' => {
753
799
  :default => 10000,
754
800
  :public => true,
@@ -951,7 +997,7 @@ module NewRelic
951
997
  },
952
998
  :'audit_log.path' => {
953
999
  :default => DefaultSource.audit_log_path,
954
- :documentation_default => 'config/newrelic_audit.log',
1000
+ :documentation_default => 'log/newrelic_audit.log',
955
1001
  :public => true,
956
1002
  :type => String,
957
1003
  :allowed_from_server => false,
@@ -1104,11 +1150,12 @@ module NewRelic
1104
1150
  :allowed_from_server => false,
1105
1151
  :description => 'If `true`, disables Active Support instrumentation.'
1106
1152
  },
1107
- :disable_activerecord_instrumentation => {
1153
+ :disable_active_record_instrumentation => {
1108
1154
  :default => value_of(:skip_ar_instrumentation),
1109
1155
  :documentation_default => false,
1110
1156
  :public => true,
1111
1157
  :type => Boolean,
1158
+ :aliases => %i[disable_activerecord_instrumentation],
1112
1159
  :allowed_from_server => false,
1113
1160
  :description => 'If `true`, disables Active Record instrumentation.'
1114
1161
  },
@@ -1117,6 +1164,7 @@ module NewRelic
1117
1164
  :public => true,
1118
1165
  :type => Boolean,
1119
1166
  :dynamic_name => true,
1167
+ :aliases => %i[disable_activerecord_notifications],
1120
1168
  :allowed_from_server => false,
1121
1169
  :description => 'If `true`, disables instrumentation for Active Record 4+'
1122
1170
  },
@@ -1318,7 +1366,7 @@ module NewRelic
1318
1366
  :type => String,
1319
1367
  :dynamic_name => true,
1320
1368
  :allowed_from_server => false,
1321
- :description => 'Controls auto-instrumentation of Curb at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1369
+ :description => 'Controls auto-instrumentation of Curb at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1322
1370
  },
1323
1371
  :'instrumentation.delayed_job' => {
1324
1372
  :default => 'auto',
@@ -1327,7 +1375,7 @@ module NewRelic
1327
1375
  :type => String,
1328
1376
  :dynamic_name => true,
1329
1377
  :allowed_from_server => false,
1330
- :description => 'Controls auto-instrumentation of Delayed Job at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1378
+ :description => 'Controls auto-instrumentation of Delayed Job at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1331
1379
  },
1332
1380
  :'instrumentation.elasticsearch' => {
1333
1381
  :default => 'auto',
@@ -1344,7 +1392,7 @@ module NewRelic
1344
1392
  :type => String,
1345
1393
  :dynamic_name => true,
1346
1394
  :allowed_from_server => false,
1347
- :description => 'Controls auto-instrumentation of Excon at start up. May be one of: `enabled`, `disabled`.'
1395
+ :description => 'Controls auto-instrumentation of Excon at start up. May be one of: `enabled`, `disabled`.'
1348
1396
  },
1349
1397
  :'instrumentation.grape' => {
1350
1398
  :default => 'auto',
@@ -1352,7 +1400,7 @@ module NewRelic
1352
1400
  :type => String,
1353
1401
  :dynamic_name => true,
1354
1402
  :allowed_from_server => false,
1355
- :description => 'Controls auto-instrumentation of Grape at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1403
+ :description => 'Controls auto-instrumentation of Grape at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1356
1404
  },
1357
1405
  :'instrumentation.grpc_client' => {
1358
1406
  :default => 'auto',
@@ -1361,7 +1409,7 @@ module NewRelic
1361
1409
  :type => String,
1362
1410
  :dynamic_name => true,
1363
1411
  :allowed_from_server => false,
1364
- :description => 'Controls auto-instrumentation of gRPC clients at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1412
+ :description => 'Controls auto-instrumentation of gRPC clients at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1365
1413
  },
1366
1414
  :'instrumentation.grpc.host_denylist' => {
1367
1415
  :default => [],
@@ -1378,7 +1426,7 @@ module NewRelic
1378
1426
  :type => String,
1379
1427
  :dynamic_name => true,
1380
1428
  :allowed_from_server => false,
1381
- :description => 'Controls auto-instrumentation of gRPC servers at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1429
+ :description => 'Controls auto-instrumentation of gRPC servers at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1382
1430
  },
1383
1431
  :'instrumentation.httpclient' => {
1384
1432
  :default => 'auto',
@@ -1387,7 +1435,7 @@ module NewRelic
1387
1435
  :type => String,
1388
1436
  :dynamic_name => true,
1389
1437
  :allowed_from_server => false,
1390
- :description => 'Controls auto-instrumentation of HTTPClient at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1438
+ :description => 'Controls auto-instrumentation of HTTPClient at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1391
1439
  },
1392
1440
  :'instrumentation.httprb' => {
1393
1441
  :default => 'auto',
@@ -1396,7 +1444,7 @@ module NewRelic
1396
1444
  :type => String,
1397
1445
  :dynamic_name => true,
1398
1446
  :allowed_from_server => false,
1399
- :description => 'Controls auto-instrumentation of http.rb gem at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1447
+ :description => 'Controls auto-instrumentation of http.rb gem at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1400
1448
  },
1401
1449
  :'instrumentation.logger' => {
1402
1450
  :default => instrumentation_value_from_boolean(:'application_logging.enabled'),
@@ -1405,7 +1453,7 @@ module NewRelic
1405
1453
  :type => String,
1406
1454
  :dynamic_name => true,
1407
1455
  :allowed_from_server => false,
1408
- :description => 'Controls auto-instrumentation of Ruby standard library Logger at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1456
+ :description => 'Controls auto-instrumentation of Ruby standard library Logger at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1409
1457
  },
1410
1458
  :'instrumentation.memcache' => {
1411
1459
  :default => 'auto',
@@ -1413,7 +1461,7 @@ module NewRelic
1413
1461
  :type => String,
1414
1462
  :dynamic_name => true,
1415
1463
  :allowed_from_server => false,
1416
- :description => 'Controls auto-instrumentation of dalli gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1464
+ :description => 'Controls auto-instrumentation of dalli gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1417
1465
  },
1418
1466
  :'instrumentation.memcached' => {
1419
1467
  :default => 'auto',
@@ -1422,7 +1470,7 @@ module NewRelic
1422
1470
  :type => String,
1423
1471
  :dynamic_name => true,
1424
1472
  :allowed_from_server => false,
1425
- :description => 'Controls auto-instrumentation of memcached gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1473
+ :description => 'Controls auto-instrumentation of memcached gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1426
1474
  },
1427
1475
  :'instrumentation.memcache_client' => {
1428
1476
  :default => 'auto',
@@ -1431,7 +1479,7 @@ module NewRelic
1431
1479
  :type => String,
1432
1480
  :dynamic_name => true,
1433
1481
  :allowed_from_server => false,
1434
- :description => 'Controls auto-instrumentation of memcache-client gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1482
+ :description => 'Controls auto-instrumentation of memcache-client gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1435
1483
  },
1436
1484
  :'instrumentation.mongo' => {
1437
1485
  :default => 'enabled',
@@ -1440,7 +1488,7 @@ module NewRelic
1440
1488
  :type => String,
1441
1489
  :dynamic_name => true,
1442
1490
  :allowed_from_server => false,
1443
- :description => 'Controls auto-instrumentation of Mongo at start up. May be one of: `enabled`, `disabled`.'
1491
+ :description => 'Controls auto-instrumentation of Mongo at start up. May be one of: `enabled`, `disabled`.'
1444
1492
  },
1445
1493
  :'instrumentation.net_http' => {
1446
1494
  :default => 'auto',
@@ -1449,7 +1497,7 @@ module NewRelic
1449
1497
  :type => String,
1450
1498
  :dynamic_name => true,
1451
1499
  :allowed_from_server => false,
1452
- :description => 'Controls auto-instrumentation of `Net::HTTP` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1500
+ :description => 'Controls auto-instrumentation of `Net::HTTP` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1453
1501
  },
1454
1502
  :'instrumentation.puma_rack' => {
1455
1503
  :default => value_of(:'instrumentation.rack'),
@@ -1460,7 +1508,7 @@ module NewRelic
1460
1508
  :allowed_from_server => false,
1461
1509
  :description => 'Controls auto-instrumentation of `Puma::Rack`. When enabled, the agent hooks into the ' \
1462
1510
  '`to_app` method in `Puma::Rack::Builder` to find gems to instrument during ' \
1463
- 'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1511
+ 'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1464
1512
  },
1465
1513
  :'instrumentation.puma_rack_urlmap' => {
1466
1514
  :default => value_of(:'instrumentation.rack_urlmap'),
@@ -1469,7 +1517,7 @@ module NewRelic
1469
1517
  :type => String,
1470
1518
  :dynamic_name => true,
1471
1519
  :allowed_from_server => false,
1472
- :description => 'Controls auto-instrumentation of `Puma::Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1520
+ :description => 'Controls auto-instrumentation of `Puma::Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1473
1521
  },
1474
1522
  :'instrumentation.rack' => {
1475
1523
  :default => 'auto',
@@ -1480,7 +1528,7 @@ module NewRelic
1480
1528
  :allowed_from_server => false,
1481
1529
  :description => 'Controls auto-instrumentation of Rack. When enabled, the agent hooks into the ' \
1482
1530
  '`to_app` method in `Rack::Builder` to find gems to instrument during ' \
1483
- 'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1531
+ 'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1484
1532
  },
1485
1533
  :'instrumentation.rack_urlmap' => {
1486
1534
  :default => 'auto',
@@ -1489,7 +1537,7 @@ module NewRelic
1489
1537
  :type => String,
1490
1538
  :dynamic_name => true,
1491
1539
  :allowed_from_server => false,
1492
- :description => 'Controls auto-instrumentation of `Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1540
+ :description => 'Controls auto-instrumentation of `Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1493
1541
  },
1494
1542
  :'instrumentation.rake' => {
1495
1543
  :default => 'auto',
@@ -1497,7 +1545,7 @@ module NewRelic
1497
1545
  :type => String,
1498
1546
  :dynamic_name => true,
1499
1547
  :allowed_from_server => false,
1500
- :description => 'Controls auto-instrumentation of rake at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1548
+ :description => 'Controls auto-instrumentation of rake at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1501
1549
  },
1502
1550
  :'instrumentation.redis' => {
1503
1551
  :default => 'auto',
@@ -1505,7 +1553,7 @@ module NewRelic
1505
1553
  :type => String,
1506
1554
  :dynamic_name => true,
1507
1555
  :allowed_from_server => false,
1508
- :description => 'Controls auto-instrumentation of Redis at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1556
+ :description => 'Controls auto-instrumentation of Redis at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1509
1557
  },
1510
1558
  :'instrumentation.resque' => {
1511
1559
  :default => 'auto',
@@ -1514,7 +1562,7 @@ module NewRelic
1514
1562
  :type => String,
1515
1563
  :dynamic_name => true,
1516
1564
  :allowed_from_server => false,
1517
- :description => 'Controls auto-instrumentation of resque at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1565
+ :description => 'Controls auto-instrumentation of resque at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1518
1566
  },
1519
1567
  :'instrumentation.sinatra' => {
1520
1568
  :default => 'auto',
@@ -1522,7 +1570,7 @@ module NewRelic
1522
1570
  :type => String,
1523
1571
  :dynamic_name => true,
1524
1572
  :allowed_from_server => false,
1525
- :description => 'Controls auto-instrumentation of Sinatra at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1573
+ :description => 'Controls auto-instrumentation of Sinatra at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1526
1574
  },
1527
1575
  :'instrumentation.thread' => {
1528
1576
  :default => 'auto',
@@ -1561,7 +1609,7 @@ module NewRelic
1561
1609
  :type => String,
1562
1610
  :dynamic_name => true,
1563
1611
  :allowed_from_server => false,
1564
- :description => 'Controls auto-instrumentation of Typhoeus at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1612
+ :description => 'Controls auto-instrumentation of Typhoeus at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1565
1613
  },
1566
1614
  # Message tracer
1567
1615
  :'message_tracer.segment_parameters.enabled' => {
@@ -1620,7 +1668,7 @@ module NewRelic
1620
1668
  'This configuration option converts the Array to a RegEx list. If you\'d like ' \
1621
1669
  'to allow all tasks by default, use `rake.tasks: [.+]`. No rake tasks will be ' \
1622
1670
  'instrumented unless they\'re added to this list. For more information, ' \
1623
- 'visit the (New Relic Rake Instrumentation docs)[/docs/apm/agents/ruby-agent/background-jobs/rake-instrumentation].'
1671
+ 'visit the [New Relic Rake Instrumentation docs](/docs/apm/agents/ruby-agent/background-jobs/rake-instrumentation).'
1624
1672
  },
1625
1673
  :'rake.connect_timeout' => {
1626
1674
  :default => 10,
@@ -15,7 +15,7 @@ module NewRelic
15
15
  module Agent
16
16
  module Configuration
17
17
  class Manager
18
- DEPENDENCY_DETECTION_VALUES = %i[prepend chain].freeze
18
+ DEPENDENCY_DETECTION_VALUES = %i[prepend chain unsatisfied].freeze
19
19
 
20
20
  # Defining these explicitly saves object allocations that we incur
21
21
  # if we use Forwardable and def_delegators.
@@ -366,7 +366,8 @@ module NewRelic
366
366
 
367
367
  preserved = @cache.select { |_k, v| DEPENDENCY_DETECTION_VALUES.include?(v) }
368
368
  new_cache
369
- preserved.each { |k, v| @cache[k] = v unless @cache[k] && @cache[k] != 'auto' }
369
+ preserved.each { |k, v| @cache[k] = v }
370
+
370
371
  @cache
371
372
  end
372
373
 
@@ -41,6 +41,7 @@ module NewRelic
41
41
 
42
42
  substitute_transaction_threshold(config)
43
43
  booleanify_values(config, 'agent_enabled', 'enabled')
44
+ apply_aliases(config)
44
45
 
45
46
  super(config, true)
46
47
  end
@@ -165,6 +166,18 @@ module NewRelic
165
166
  end
166
167
  result
167
168
  end
169
+
170
+ def apply_aliases(config)
171
+ DEFAULTS.each do |config_setting, value|
172
+ next unless value[:aliases]
173
+
174
+ value[:aliases].each do |config_alias|
175
+ next unless config[config_setting].nil? && !config[config_alias.to_s].nil?
176
+
177
+ config[config_setting] = config[config_alias.to_s]
178
+ end
179
+ end
180
+ end
168
181
  end
169
182
  end
170
183
  end
@@ -87,7 +87,7 @@ module NewRelic
87
87
  # header-friendly string returned from
88
88
  # {DistributedTracePayload#http_safe}
89
89
  #
90
- # @param transport_Type [String] May be one of: +HTTP+, +HTTPS+, +Kafka+, +JMS+,
90
+ # @param transport_type [String] May be one of: +HTTP+, +HTTPS+, +Kafka+, +JMS+,
91
91
  # +IronMQ+, +AMQP+, +Queue+, +Other+. Values are
92
92
  # case sensitive. All other values result in +Unknown+
93
93
  #
@@ -148,7 +148,7 @@ DependencyDetection.defer do
148
148
  end
149
149
 
150
150
  depends_on do
151
- !NewRelic::Agent.config[:disable_activerecord_instrumentation]
151
+ !NewRelic::Agent.config[:disable_active_record_instrumentation]
152
152
  end
153
153
 
154
154
  executes do
@@ -90,7 +90,8 @@ DependencyDetection.defer do
90
90
  end
91
91
 
92
92
  depends_on do
93
- !NewRelic::Agent.config[:disable_activerecord_instrumentation] &&
93
+ !NewRelic::Agent.config[:disable_active_record_instrumentation] &&
94
+ !NewRelic::Agent.config[:disable_active_record_notifications] &&
94
95
  !NewRelic::Agent::Instrumentation::ActiveRecordSubscriber.subscribed?
95
96
  end
96
97
 
@@ -13,7 +13,7 @@ module NewRelic::Agent::Instrumentation
13
13
  def post(*args, &task)
14
14
  return post_without_new_relic(*args, &task) unless NewRelic::Agent::Tracer.tracing_enabled?
15
15
 
16
- traced_task = add_task_tracing(*args, &task)
16
+ traced_task = add_task_tracing(&task)
17
17
  post_without_new_relic(*args, &traced_task)
18
18
  end
19
19
  end
@@ -7,11 +7,10 @@ module NewRelic::Agent::Instrumentation
7
7
  SEGMENT_NAME = 'Concurrent/Task'
8
8
  SUPPORTABILITY_METRIC = 'Supportability/ConcurrentRuby/Invoked'
9
9
 
10
- def add_task_tracing(*args, &task)
10
+ def add_task_tracing(&task)
11
11
  NewRelic::Agent.record_metric_once(SUPPORTABILITY_METRIC)
12
12
 
13
13
  NewRelic::Agent::Tracer.thread_block_with_current_transaction(
14
- *args,
15
14
  segment_name: SEGMENT_NAME,
16
15
  parent: NewRelic::Agent::Tracer.current_segment,
17
16
  &task
@@ -10,7 +10,7 @@ module NewRelic::Agent::Instrumentation
10
10
  def post(*args, &task)
11
11
  return super(*args, &task) unless NewRelic::Agent::Tracer.tracing_enabled?
12
12
 
13
- traced_task = add_task_tracing(*args, &task)
13
+ traced_task = add_task_tracing(&task)
14
14
  super(*args, &traced_task)
15
15
  end
16
16
  end
@@ -10,9 +10,16 @@ module NewRelic::Agent::Instrumentation
10
10
 
11
11
  alias_method(:initialize_without_new_relic, :initialize)
12
12
 
13
- def initialize(*args, &block)
14
- traced_block = add_thread_tracing(*args, &block)
15
- initialize_with_newrelic_tracing { initialize_without_new_relic(*args, &traced_block) }
13
+ if RUBY_VERSION < '2.7.0'
14
+ def initialize(*_args, &block)
15
+ traced_block = add_thread_tracing(&block)
16
+ initialize_with_newrelic_tracing { initialize_without_new_relic(&traced_block) }
17
+ end
18
+ else
19
+ def initialize(**kwargs, &block)
20
+ traced_block = add_thread_tracing(&block)
21
+ initialize_with_newrelic_tracing { initialize_without_new_relic(**kwargs, &traced_block) }
22
+ end
16
23
  end
17
24
  end
18
25
  end
@@ -11,11 +11,10 @@ module NewRelic::Agent::Instrumentation
11
11
  yield
12
12
  end
13
13
 
14
- def add_thread_tracing(*args, &block)
14
+ def add_thread_tracing(&block)
15
15
  return block if !NewRelic::Agent::Tracer.thread_tracing_enabled?
16
16
 
17
17
  NewRelic::Agent::Tracer.thread_block_with_current_transaction(
18
- *args,
19
18
  segment_name: 'Ruby/Fiber',
20
19
  &block
21
20
  )
@@ -9,9 +9,16 @@ module NewRelic::Agent::Instrumentation
9
9
  module Prepend
10
10
  include NewRelic::Agent::Instrumentation::MonitoredFiber
11
11
 
12
- def initialize(*args, &block)
13
- traced_block = add_thread_tracing(*args, &block)
14
- initialize_with_newrelic_tracing { super(*args, &traced_block) }
12
+ if RUBY_VERSION < '2.7.0'
13
+ def initialize(*_args, &block)
14
+ traced_block = add_thread_tracing(&block)
15
+ initialize_with_newrelic_tracing { super(&traced_block) }
16
+ end
17
+ else
18
+ def initialize(**kawrgs, &block)
19
+ traced_block = add_thread_tracing(&block)
20
+ initialize_with_newrelic_tracing { super(**kawrgs, &traced_block) }
21
+ end
15
22
  end
16
23
  end
17
24
  end