newrelic_rpm 9.2.2 → 9.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.build_ignore +26 -0
  3. data/CHANGELOG.md +168 -0
  4. data/README.md +8 -4
  5. data/lib/new_relic/agent/attribute_pre_filtering.rb +109 -0
  6. data/lib/new_relic/agent/configuration/default_source.rb +176 -32
  7. data/lib/new_relic/agent/configuration/environment_source.rb +1 -1
  8. data/lib/new_relic/agent/configuration/manager.rb +3 -2
  9. data/lib/new_relic/agent/configuration/yaml_source.rb +13 -0
  10. data/lib/new_relic/agent/distributed_tracing.rb +1 -1
  11. data/lib/new_relic/agent/instrumentation/action_controller_other_subscriber.rb +1 -1
  12. data/lib/new_relic/agent/instrumentation/active_record.rb +1 -1
  13. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +2 -1
  14. data/lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb +4 -0
  15. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +9 -0
  16. data/lib/new_relic/agent/instrumentation/concurrent_ruby/chain.rb +1 -1
  17. data/lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb +3 -4
  18. data/lib/new_relic/agent/instrumentation/concurrent_ruby/prepend.rb +1 -1
  19. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -2
  20. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +4 -0
  21. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +3 -0
  22. data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +4 -1
  23. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +3 -0
  24. data/lib/new_relic/agent/instrumentation/fiber/chain.rb +10 -3
  25. data/lib/new_relic/agent/instrumentation/fiber/instrumentation.rb +1 -2
  26. data/lib/new_relic/agent/instrumentation/fiber/prepend.rb +10 -3
  27. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +4 -0
  28. data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +4 -0
  29. data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +4 -0
  30. data/lib/new_relic/agent/instrumentation/grpc_client.rb +1 -1
  31. data/lib/new_relic/agent/instrumentation/grpc_server.rb +1 -1
  32. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +4 -0
  33. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +4 -0
  34. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +3 -0
  35. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +12 -3
  36. data/lib/new_relic/agent/instrumentation/memcache.rb +2 -2
  37. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +4 -0
  38. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +4 -0
  39. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +4 -0
  40. data/lib/new_relic/agent/instrumentation/queue_time.rb +1 -1
  41. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +6 -0
  42. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +4 -0
  43. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +1 -1
  44. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +4 -0
  45. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +4 -0
  46. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +4 -0
  47. data/lib/new_relic/agent/instrumentation/roda/chain.rb +43 -0
  48. data/lib/new_relic/agent/instrumentation/roda/instrumentation.rb +56 -0
  49. data/lib/new_relic/agent/instrumentation/roda/prepend.rb +24 -0
  50. data/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb +30 -0
  51. data/lib/new_relic/agent/instrumentation/roda.rb +34 -0
  52. data/lib/new_relic/agent/instrumentation/sequel.rb +1 -1
  53. data/lib/new_relic/agent/instrumentation/sidekiq/client.rb +4 -0
  54. data/lib/new_relic/agent/instrumentation/sidekiq/server.rb +26 -3
  55. data/lib/new_relic/agent/instrumentation/sidekiq.rb +2 -2
  56. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +4 -0
  57. data/lib/new_relic/agent/instrumentation/stripe.rb +28 -0
  58. data/lib/new_relic/agent/instrumentation/stripe_subscriber.rb +77 -0
  59. data/lib/new_relic/agent/instrumentation/thread/chain.rb +1 -1
  60. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +0 -1
  61. data/lib/new_relic/agent/instrumentation/thread/prepend.rb +1 -1
  62. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +4 -0
  63. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +5 -1
  64. data/lib/new_relic/agent/log_event_aggregator.rb +49 -2
  65. data/lib/new_relic/agent/log_event_attributes.rb +115 -0
  66. data/lib/new_relic/agent/logging.rb +4 -4
  67. data/lib/new_relic/agent/method_tracer_helpers.rb +26 -5
  68. data/lib/new_relic/agent/new_relic_service.rb +33 -17
  69. data/lib/new_relic/agent/pipe_service.rb +1 -1
  70. data/lib/new_relic/agent/tracer.rb +6 -5
  71. data/lib/new_relic/agent/transaction/abstract_segment.rb +52 -0
  72. data/lib/new_relic/agent/transaction/request_attributes.rb +45 -7
  73. data/lib/new_relic/agent/transaction.rb +5 -4
  74. data/lib/new_relic/agent/utilization/vendor.rb +5 -7
  75. data/lib/new_relic/agent.rb +50 -1
  76. data/lib/new_relic/cli/command.rb +1 -0
  77. data/lib/new_relic/control/class_methods.rb +1 -7
  78. data/lib/new_relic/control/frameworks/roda.rb +20 -0
  79. data/lib/new_relic/dependency_detection.rb +6 -0
  80. data/lib/new_relic/language_support.rb +5 -0
  81. data/lib/new_relic/latest_changes.rb +1 -1
  82. data/lib/new_relic/noticed_error.rb +5 -2
  83. data/lib/new_relic/rack/agent_hooks.rb +1 -1
  84. data/lib/new_relic/rack/agent_middleware.rb +0 -16
  85. data/lib/new_relic/rack/browser_monitoring.rb +1 -1
  86. data/lib/new_relic/supportability_helper.rb +2 -0
  87. data/lib/new_relic/traced_thread.rb +2 -3
  88. data/lib/new_relic/version.rb +2 -2
  89. data/lib/sequel/extensions/new_relic_instrumentation.rb +1 -1
  90. data/lib/tasks/bump_version.rake +21 -0
  91. data/lib/tasks/config.rake +3 -2
  92. data/lib/tasks/helpers/config.html.erb +93 -0
  93. data/lib/tasks/helpers/format.rb +11 -7
  94. data/lib/tasks/helpers/newrelicyml.rb +144 -0
  95. data/lib/tasks/helpers/version_bump.rb +62 -0
  96. data/lib/tasks/newrelicyml.rake +13 -0
  97. data/newrelic.yml +362 -265
  98. data/newrelic_rpm.gemspec +11 -7
  99. metadata +36 -25
  100. data/.gitignore +0 -43
  101. data/.project +0 -23
  102. data/.rubocop.yml +0 -1845
  103. data/.rubocop_todo.yml +0 -61
  104. data/.simplecov +0 -16
  105. data/.snyk +0 -11
  106. data/.yardopts +0 -27
  107. data/Brewfile +0 -13
  108. data/DOCKER.md +0 -167
  109. data/Dockerfile +0 -10
  110. data/Guardfile +0 -27
  111. data/config/database.yml +0 -5
  112. data/config.dot +0 -278
  113. data/docker-compose.yml +0 -107
  114. data/lefthook.yml +0 -9
  115. data/lib/tasks/helpers/removers.rb +0 -33
  116. data/lib/tasks/multiverse.rake +0 -6
  117. data/lib/tasks/multiverse.rb +0 -84
@@ -3,6 +3,7 @@
3
3
  # frozen_string_literal: true
4
4
 
5
5
  require 'forwardable'
6
+ require_relative '../../constants'
6
7
 
7
8
  module NewRelic
8
9
  module Agent
@@ -24,7 +25,7 @@ module NewRelic
24
25
  # Does not appear in logs.
25
26
  def self.deprecated_description(new_setting, description)
26
27
  link_ref = new_setting.to_s.tr('.', '-')
27
- %{Please see: [#{new_setting}](docs/agents/ruby-agent/configuration/ruby-agent-configuration##{link_ref}). \n\n#{description}}
28
+ %{Please see: [#{new_setting}](##{link_ref}). \n\n#{description}}
28
29
  end
29
30
 
30
31
  class Boolean
@@ -115,6 +116,7 @@ module NewRelic
115
116
  :rails_notifications
116
117
  end
117
118
  when defined?(::Sinatra) && defined?(::Sinatra::Base) then :sinatra
119
+ when defined?(::Roda) then :roda
118
120
  when defined?(::NewRelic::IA) then :external
119
121
  else :ruby
120
122
  end
@@ -211,6 +213,22 @@ module NewRelic
211
213
  end
212
214
  end
213
215
 
216
+ def self.convert_to_hash(value)
217
+ return value if value.is_a?(Hash)
218
+
219
+ if value.is_a?(String)
220
+ return value.split(',').each_with_object({}) do |item, hash|
221
+ key, value = item.split('=')
222
+ hash[key] = value
223
+ end
224
+ end
225
+
226
+ raise ArgumentError.new(
227
+ "Config value '#{value}' of " \
228
+ "class #{value.class} couldn't be turned into a Hash."
229
+ )
230
+ end
231
+
214
232
  SEMICOLON = ';'.freeze
215
233
  def self.convert_to_list_on_semicolon(value)
216
234
  case value
@@ -427,7 +445,7 @@ module NewRelic
427
445
  'Known use-case for this option is where Sinatra is running as an embedded service within another framework ' \
428
446
  'and the agent is detecting the Sinatra app and skipping the `at_exit` handler as a result. Sinatra classically ' \
429
447
  '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.'
448
+ 'was also installed in those circumstances. Note: `send_data_on_exit` should also be set to `true` in tandem with this setting.'
431
449
  },
432
450
  :high_security => {
433
451
  :default => false,
@@ -588,8 +606,7 @@ module NewRelic
588
606
 
589
607
  - If you do not want the agent to capture query information, set this to `none`.
590
608
  - 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
- '
609
+ - When you enable [high security mode](/docs/agents/manage-apm-agents/configuration/high-security-mode), this is automatically set to `obfuscated`.'
593
610
  },
594
611
 
595
612
  :'transaction_tracer.stack_trace_threshold' => {
@@ -749,6 +766,37 @@ module NewRelic
749
766
  :allowed_from_server => false,
750
767
  :description => 'If `true`, the agent captures log records emitted by your application.'
751
768
  },
769
+ :'application_logging.forwarding.log_level' => {
770
+ :default => 'debug',
771
+ :public => true,
772
+ :type => String,
773
+ :allowed_from_server => false,
774
+ :description => <<~DESCRIPTION
775
+ Sets the minimum level a log event must have to be forwarded to New Relic.
776
+
777
+ This is based on the integer values of Ruby's `Logger::Severity` constants: https://github.com/ruby/ruby/blob/master/lib/logger/severity.rb
778
+
779
+ The intention is to forward logs with the level given to the configuration, as well as any logs with a higher level of severity.
780
+
781
+ 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".
782
+
783
+ Valid values (ordered lowest to highest):
784
+ * "debug"
785
+ * "info"
786
+ * "warn"
787
+ * "error"
788
+ * "fatal"
789
+ * "unknown"
790
+ DESCRIPTION
791
+ },
792
+ :'application_logging.forwarding.custom_attributes' => {
793
+ :default => {},
794
+ :public => true,
795
+ :type => Hash,
796
+ :transform => DefaultSource.method(:convert_to_hash),
797
+ :allowed_from_server => false,
798
+ :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"'
799
+ },
752
800
  :'application_logging.forwarding.max_samples_stored' => {
753
801
  :default => 10000,
754
802
  :public => true,
@@ -772,6 +820,13 @@ module NewRelic
772
820
  :description => 'If `true`, the agent captures metrics related to logging for your application.'
773
821
  },
774
822
  # Attributes
823
+ :'allow_all_headers' => {
824
+ :default => false,
825
+ :public => true,
826
+ :type => Boolean,
827
+ :allowed_from_server => false,
828
+ :description => 'If `true`, enables capture of all HTTP request headers for all destinations.'
829
+ },
775
830
  :'attributes.enabled' => {
776
831
  :default => true,
777
832
  :public => true,
@@ -951,7 +1006,7 @@ module NewRelic
951
1006
  },
952
1007
  :'audit_log.path' => {
953
1008
  :default => DefaultSource.audit_log_path,
954
- :documentation_default => 'config/newrelic_audit.log',
1009
+ :documentation_default => 'log/newrelic_audit.log',
955
1010
  :public => true,
956
1011
  :type => String,
957
1012
  :allowed_from_server => false,
@@ -996,7 +1051,7 @@ module NewRelic
996
1051
  :allowed_from_server => true,
997
1052
  :deprecated => true,
998
1053
  :description => deprecated_description(
999
- :'distributed_tracing-enabled',
1054
+ :'distributed_tracing.enabled',
1000
1055
  'If `true`, enables [cross-application tracing](/docs/agents/ruby-agent/features/cross-application-tracing-ruby/) when `distributed_tracing.enabled` is set to `false`.'
1001
1056
  )
1002
1057
  },
@@ -1104,11 +1159,12 @@ module NewRelic
1104
1159
  :allowed_from_server => false,
1105
1160
  :description => 'If `true`, disables Active Support instrumentation.'
1106
1161
  },
1107
- :disable_activerecord_instrumentation => {
1162
+ :disable_active_record_instrumentation => {
1108
1163
  :default => value_of(:skip_ar_instrumentation),
1109
1164
  :documentation_default => false,
1110
1165
  :public => true,
1111
1166
  :type => Boolean,
1167
+ :aliases => %i[disable_activerecord_instrumentation],
1112
1168
  :allowed_from_server => false,
1113
1169
  :description => 'If `true`, disables Active Record instrumentation.'
1114
1170
  },
@@ -1117,6 +1173,7 @@ module NewRelic
1117
1173
  :public => true,
1118
1174
  :type => Boolean,
1119
1175
  :dynamic_name => true,
1176
+ :aliases => %i[disable_activerecord_notifications],
1120
1177
  :allowed_from_server => false,
1121
1178
  :description => 'If `true`, disables instrumentation for Active Record 4+'
1122
1179
  },
@@ -1156,7 +1213,13 @@ module NewRelic
1156
1213
  :public => true,
1157
1214
  :type => Boolean,
1158
1215
  :allowed_from_server => false,
1159
- :description => 'If `true`, the agent won\'t wrap third-party middlewares in instrumentation (regardless of whether they are installed via `Rack::Builder` or Rails).'
1216
+ :description => <<~DESCRIPTION
1217
+ If `true`, the agent won't wrap third-party middlewares in instrumentation (regardless of whether they are installed via `Rack::Builder` or Rails).
1218
+
1219
+ <Callout variant="important">
1220
+ When middleware instrumentation is disabled, if an application is using middleware that could alter the response code, the HTTP status code reported on the transaction may not reflect the altered value.
1221
+ </Callout>
1222
+ DESCRIPTION
1160
1223
  },
1161
1224
  :disable_samplers => {
1162
1225
  :default => false,
@@ -1179,6 +1242,13 @@ module NewRelic
1179
1242
  :allowed_from_server => false,
1180
1243
  :description => 'If `true`, disables [Sidekiq instrumentation](/docs/agents/ruby-agent/background-jobs/sidekiq-instrumentation).'
1181
1244
  },
1245
+ :disable_roda_auto_middleware => {
1246
+ :default => false,
1247
+ :public => true,
1248
+ :type => Boolean,
1249
+ :allowed_from_server => false,
1250
+ :description => 'If `true`, disables agent middleware for Roda. This middleware is responsible for advanced feature support such as [page load timing](/docs/browser/new-relic-browser/getting-started/new-relic-browser) and [error collection](/docs/apm/applications-menu/events/view-apm-error-analytics).'
1251
+ },
1182
1252
  :disable_sinatra_auto_middleware => {
1183
1253
  :default => false,
1184
1254
  :public => true,
@@ -1318,7 +1388,7 @@ module NewRelic
1318
1388
  :type => String,
1319
1389
  :dynamic_name => true,
1320
1390
  :allowed_from_server => false,
1321
- :description => 'Controls auto-instrumentation of Curb at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1391
+ :description => 'Controls auto-instrumentation of Curb at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1322
1392
  },
1323
1393
  :'instrumentation.delayed_job' => {
1324
1394
  :default => 'auto',
@@ -1327,7 +1397,7 @@ module NewRelic
1327
1397
  :type => String,
1328
1398
  :dynamic_name => true,
1329
1399
  :allowed_from_server => false,
1330
- :description => 'Controls auto-instrumentation of Delayed Job at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1400
+ :description => 'Controls auto-instrumentation of Delayed Job at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1331
1401
  },
1332
1402
  :'instrumentation.elasticsearch' => {
1333
1403
  :default => 'auto',
@@ -1344,7 +1414,7 @@ module NewRelic
1344
1414
  :type => String,
1345
1415
  :dynamic_name => true,
1346
1416
  :allowed_from_server => false,
1347
- :description => 'Controls auto-instrumentation of Excon at start up. May be one of: `enabled`, `disabled`.'
1417
+ :description => 'Controls auto-instrumentation of Excon at start up. May be one of: `enabled`, `disabled`.'
1348
1418
  },
1349
1419
  :'instrumentation.grape' => {
1350
1420
  :default => 'auto',
@@ -1352,7 +1422,7 @@ module NewRelic
1352
1422
  :type => String,
1353
1423
  :dynamic_name => true,
1354
1424
  :allowed_from_server => false,
1355
- :description => 'Controls auto-instrumentation of Grape at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1425
+ :description => 'Controls auto-instrumentation of Grape at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1356
1426
  },
1357
1427
  :'instrumentation.grpc_client' => {
1358
1428
  :default => 'auto',
@@ -1361,7 +1431,7 @@ module NewRelic
1361
1431
  :type => String,
1362
1432
  :dynamic_name => true,
1363
1433
  :allowed_from_server => false,
1364
- :description => 'Controls auto-instrumentation of gRPC clients at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1434
+ :description => 'Controls auto-instrumentation of gRPC clients at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1365
1435
  },
1366
1436
  :'instrumentation.grpc.host_denylist' => {
1367
1437
  :default => [],
@@ -1378,7 +1448,7 @@ module NewRelic
1378
1448
  :type => String,
1379
1449
  :dynamic_name => true,
1380
1450
  :allowed_from_server => false,
1381
- :description => 'Controls auto-instrumentation of gRPC servers at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1451
+ :description => 'Controls auto-instrumentation of gRPC servers at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1382
1452
  },
1383
1453
  :'instrumentation.httpclient' => {
1384
1454
  :default => 'auto',
@@ -1387,7 +1457,7 @@ module NewRelic
1387
1457
  :type => String,
1388
1458
  :dynamic_name => true,
1389
1459
  :allowed_from_server => false,
1390
- :description => 'Controls auto-instrumentation of HTTPClient at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1460
+ :description => 'Controls auto-instrumentation of HTTPClient at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1391
1461
  },
1392
1462
  :'instrumentation.httprb' => {
1393
1463
  :default => 'auto',
@@ -1396,7 +1466,7 @@ module NewRelic
1396
1466
  :type => String,
1397
1467
  :dynamic_name => true,
1398
1468
  :allowed_from_server => false,
1399
- :description => 'Controls auto-instrumentation of http.rb gem at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1469
+ :description => 'Controls auto-instrumentation of http.rb gem at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1400
1470
  },
1401
1471
  :'instrumentation.logger' => {
1402
1472
  :default => instrumentation_value_from_boolean(:'application_logging.enabled'),
@@ -1405,7 +1475,7 @@ module NewRelic
1405
1475
  :type => String,
1406
1476
  :dynamic_name => true,
1407
1477
  :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`.'
1478
+ :description => 'Controls auto-instrumentation of Ruby standard library Logger at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1409
1479
  },
1410
1480
  :'instrumentation.memcache' => {
1411
1481
  :default => 'auto',
@@ -1413,7 +1483,7 @@ module NewRelic
1413
1483
  :type => String,
1414
1484
  :dynamic_name => true,
1415
1485
  :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`.'
1486
+ :description => 'Controls auto-instrumentation of dalli gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1417
1487
  },
1418
1488
  :'instrumentation.memcached' => {
1419
1489
  :default => 'auto',
@@ -1422,7 +1492,7 @@ module NewRelic
1422
1492
  :type => String,
1423
1493
  :dynamic_name => true,
1424
1494
  :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`.'
1495
+ :description => 'Controls auto-instrumentation of memcached gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1426
1496
  },
1427
1497
  :'instrumentation.memcache_client' => {
1428
1498
  :default => 'auto',
@@ -1431,7 +1501,7 @@ module NewRelic
1431
1501
  :type => String,
1432
1502
  :dynamic_name => true,
1433
1503
  :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`.'
1504
+ :description => 'Controls auto-instrumentation of memcache-client gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1435
1505
  },
1436
1506
  :'instrumentation.mongo' => {
1437
1507
  :default => 'enabled',
@@ -1440,7 +1510,7 @@ module NewRelic
1440
1510
  :type => String,
1441
1511
  :dynamic_name => true,
1442
1512
  :allowed_from_server => false,
1443
- :description => 'Controls auto-instrumentation of Mongo at start up. May be one of: `enabled`, `disabled`.'
1513
+ :description => 'Controls auto-instrumentation of Mongo at start up. May be one of: `enabled`, `disabled`.'
1444
1514
  },
1445
1515
  :'instrumentation.net_http' => {
1446
1516
  :default => 'auto',
@@ -1449,7 +1519,7 @@ module NewRelic
1449
1519
  :type => String,
1450
1520
  :dynamic_name => true,
1451
1521
  :allowed_from_server => false,
1452
- :description => 'Controls auto-instrumentation of `Net::HTTP` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1522
+ :description => 'Controls auto-instrumentation of `Net::HTTP` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1453
1523
  },
1454
1524
  :'instrumentation.puma_rack' => {
1455
1525
  :default => value_of(:'instrumentation.rack'),
@@ -1460,7 +1530,7 @@ module NewRelic
1460
1530
  :allowed_from_server => false,
1461
1531
  :description => 'Controls auto-instrumentation of `Puma::Rack`. When enabled, the agent hooks into the ' \
1462
1532
  '`to_app` method in `Puma::Rack::Builder` to find gems to instrument during ' \
1463
- 'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1533
+ 'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1464
1534
  },
1465
1535
  :'instrumentation.puma_rack_urlmap' => {
1466
1536
  :default => value_of(:'instrumentation.rack_urlmap'),
@@ -1469,7 +1539,7 @@ module NewRelic
1469
1539
  :type => String,
1470
1540
  :dynamic_name => true,
1471
1541
  :allowed_from_server => false,
1472
- :description => 'Controls auto-instrumentation of `Puma::Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1542
+ :description => 'Controls auto-instrumentation of `Puma::Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1473
1543
  },
1474
1544
  :'instrumentation.rack' => {
1475
1545
  :default => 'auto',
@@ -1480,7 +1550,7 @@ module NewRelic
1480
1550
  :allowed_from_server => false,
1481
1551
  :description => 'Controls auto-instrumentation of Rack. When enabled, the agent hooks into the ' \
1482
1552
  '`to_app` method in `Rack::Builder` to find gems to instrument during ' \
1483
- 'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1553
+ 'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1484
1554
  },
1485
1555
  :'instrumentation.rack_urlmap' => {
1486
1556
  :default => 'auto',
@@ -1489,7 +1559,7 @@ module NewRelic
1489
1559
  :type => String,
1490
1560
  :dynamic_name => true,
1491
1561
  :allowed_from_server => false,
1492
- :description => 'Controls auto-instrumentation of `Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1562
+ :description => 'Controls auto-instrumentation of `Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1493
1563
  },
1494
1564
  :'instrumentation.rake' => {
1495
1565
  :default => 'auto',
@@ -1497,7 +1567,7 @@ module NewRelic
1497
1567
  :type => String,
1498
1568
  :dynamic_name => true,
1499
1569
  :allowed_from_server => false,
1500
- :description => 'Controls auto-instrumentation of rake at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1570
+ :description => 'Controls auto-instrumentation of rake at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1501
1571
  },
1502
1572
  :'instrumentation.redis' => {
1503
1573
  :default => 'auto',
@@ -1505,7 +1575,7 @@ module NewRelic
1505
1575
  :type => String,
1506
1576
  :dynamic_name => true,
1507
1577
  :allowed_from_server => false,
1508
- :description => 'Controls auto-instrumentation of Redis at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1578
+ :description => 'Controls auto-instrumentation of Redis at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1509
1579
  },
1510
1580
  :'instrumentation.resque' => {
1511
1581
  :default => 'auto',
@@ -1514,7 +1584,15 @@ module NewRelic
1514
1584
  :type => String,
1515
1585
  :dynamic_name => true,
1516
1586
  :allowed_from_server => false,
1517
- :description => 'Controls auto-instrumentation of resque at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1587
+ :description => 'Controls auto-instrumentation of resque at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1588
+ },
1589
+ :'instrumentation.roda' => {
1590
+ :default => 'auto',
1591
+ :public => true,
1592
+ :type => String,
1593
+ :dynamic_name => true,
1594
+ :allowed_from_server => false,
1595
+ :description => 'Controls auto-instrumentation of Roda at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1518
1596
  },
1519
1597
  :'instrumentation.sinatra' => {
1520
1598
  :default => 'auto',
@@ -1522,7 +1600,42 @@ module NewRelic
1522
1600
  :type => String,
1523
1601
  :dynamic_name => true,
1524
1602
  :allowed_from_server => false,
1525
- :description => 'Controls auto-instrumentation of Sinatra at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1603
+ :description => 'Controls auto-instrumentation of Sinatra at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1604
+ },
1605
+ :'instrumentation.stripe' => {
1606
+ :default => 'enabled',
1607
+ :public => true,
1608
+ :type => String,
1609
+ :allowed_from_server => false,
1610
+ :description => 'Controls auto-instrumentation of Stripe at startup. May be one of: `enabled`, `disabled`.'
1611
+ },
1612
+ :'stripe.user_data.include' => {
1613
+ default: NewRelic::EMPTY_ARRAY,
1614
+ public: true,
1615
+ type: Array,
1616
+ dynamic_name: true,
1617
+ allowed_from_server: false,
1618
+ :transform => DefaultSource.method(:convert_to_list),
1619
+ :description => <<~DESCRIPTION
1620
+ An array of strings to specify which keys inside a Stripe event's `user_data` hash should be reported
1621
+ to New Relic. Each string in this array will be turned into a regular expression via `Regexp.new` to
1622
+ permit advanced matching. Setting the value to `["."]` will report all `user_data`.
1623
+ DESCRIPTION
1624
+ },
1625
+ :'stripe.user_data.exclude' => {
1626
+ default: NewRelic::EMPTY_ARRAY,
1627
+ public: true,
1628
+ type: Array,
1629
+ dynamic_name: true,
1630
+ allowed_from_server: false,
1631
+ :transform => DefaultSource.method(:convert_to_list),
1632
+ :description => <<~DESCRIPTION
1633
+ An array of strings to specify which keys and/or values inside a Stripe event's `user_data` hash should
1634
+ not be reported to New Relic. Each string in this array will be turned into a regular expression via
1635
+ `Regexp.new` to permit advanced matching. For each hash pair, if either the key or value is matched the
1636
+ pair will not be reported. By default, no `user_data` is reported, so this option should only be used if
1637
+ the `stripe.user_data.include` option is being used.
1638
+ DESCRIPTION
1526
1639
  },
1527
1640
  :'instrumentation.thread' => {
1528
1641
  :default => 'auto',
@@ -1561,7 +1674,7 @@ module NewRelic
1561
1674
  :type => String,
1562
1675
  :dynamic_name => true,
1563
1676
  :allowed_from_server => false,
1564
- :description => 'Controls auto-instrumentation of Typhoeus at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1677
+ :description => 'Controls auto-instrumentation of Typhoeus at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1565
1678
  },
1566
1679
  # Message tracer
1567
1680
  :'message_tracer.segment_parameters.enabled' => {
@@ -1620,7 +1733,7 @@ module NewRelic
1620
1733
  'This configuration option converts the Array to a RegEx list. If you\'d like ' \
1621
1734
  'to allow all tasks by default, use `rake.tasks: [.+]`. No rake tasks will be ' \
1622
1735
  '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].'
1736
+ 'visit the [New Relic Rake Instrumentation docs](/docs/apm/agents/ruby-agent/background-jobs/rake-instrumentation).'
1624
1737
  },
1625
1738
  :'rake.connect_timeout' => {
1626
1739
  :default => 10,
@@ -1638,6 +1751,37 @@ module NewRelic
1638
1751
  :transform => DefaultSource.method(:convert_to_regexp_list),
1639
1752
  :description => 'Define transactions you want the agent to ignore, by specifying a list of patterns matching the URI you want to ignore. For more detail, see [the docs on ignoring specific transactions](/docs/agents/ruby-agent/api-guides/ignoring-specific-transactions/#config-ignoring).'
1640
1753
  },
1754
+ # Sidekiq
1755
+ :'sidekiq.args.include' => {
1756
+ default: NewRelic::EMPTY_ARRAY,
1757
+ public: true,
1758
+ type: Array,
1759
+ dynamic_name: true,
1760
+ allowed_from_server: false,
1761
+ description: <<~SIDEKIQ_ARGS_INCLUDE.chomp.tr("\n", ' ')
1762
+ An array of strings that will collectively serve as an allowlist for filtering which Sidekiq
1763
+ job arguments get reported to New Relic. To capture any Sidekiq arguments,
1764
+ 'job.sidekiq.args.*' must be added to the separate `:'attributes.include'` configuration option. Each
1765
+ string in this array will be turned into a regular expression via `Regexp.new` to permit advanced
1766
+ matching. For job argument hashes, if either a key or value matches the pair will be included. All
1767
+ matching job argument array elements and job argument scalars will be included.
1768
+ SIDEKIQ_ARGS_INCLUDE
1769
+ },
1770
+ :'sidekiq.args.exclude' => {
1771
+ default: NewRelic::EMPTY_ARRAY,
1772
+ public: true,
1773
+ type: Array,
1774
+ dynamic_name: true,
1775
+ allowed_from_server: false,
1776
+ description: <<~SIDEKIQ_ARGS_EXCLUDE.chomp.tr("\n", ' ')
1777
+ An array of strings that will collectively serve as a denylist for filtering which Sidekiq
1778
+ job arguments get reported to New Relic. To capture any Sidekiq arguments,
1779
+ 'job.sidekiq.args.*' must be added to the separate `:'attributes.include'` configuration option. Each string
1780
+ in this array will be turned into a regular expression via `Regexp.new` to permit advanced matching.
1781
+ For job argument hashes, if either a key or value matches the pair will be excluded. All matching job
1782
+ argument array elements and job argument scalars will be excluded.
1783
+ SIDEKIQ_ARGS_EXCLUDE
1784
+ },
1641
1785
  # Slow SQL
1642
1786
  :'slow_sql.enabled' => {
1643
1787
  :default => value_of(:'transaction_tracer.enabled'),
@@ -101,7 +101,7 @@ module NewRelic
101
101
  end
102
102
  else
103
103
  ::NewRelic::Agent.logger.info("#{environment_key} does not have a corresponding configuration setting (#{config_key} does not exist).")
104
- ::NewRelic::Agent.logger.info('Run `rake newrelic:config:docs` or visit https://newrelic.com/docs/ruby/ruby-agent-configuration to see a list of available configuration settings.')
104
+ ::NewRelic::Agent.logger.info('Run `rake newrelic:config:docs` or visit https://docs.newrelic.com/docs/apm/agents/ruby-agent/configuration/ruby-agent-configuration to see a list of available configuration settings.')
105
105
  self[config_key] = value
106
106
  end
107
107
  end
@@ -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
  #
@@ -23,7 +23,7 @@ module NewRelic
23
23
 
24
24
  def metric_name(name, payload)
25
25
  controller_name = controller_name_for_metric(payload)
26
- "Ruby/ActionController#{"/#{controller_name}" if controller_name}/#{name.gsub(/\.action_controller/, '')}"
26
+ "Ruby/ActionController#{"/#{controller_name}" if controller_name}/#{name.gsub('.action_controller', '')}"
27
27
  end
28
28
 
29
29
  def controller_name_for_metric(payload)
@@ -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
 
@@ -6,8 +6,12 @@ module NewRelic
6
6
  module Agent
7
7
  module Instrumentation
8
8
  module ActiveSupportLogger
9
+ INSTRUMENTATION_NAME = NewRelic::Agent.base_name(name)
10
+
9
11
  # Mark @skip_instrumenting on any broadcasted loggers to instrument Rails.logger only
10
12
  def broadcast_with_tracing(logger)
13
+ NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)
14
+
11
15
  NewRelic::Agent::Instrumentation::Logger.mark_skip_instrumenting(logger)
12
16
  yield
13
17
  rescue => error
@@ -12,6 +12,7 @@ module NewRelic
12
12
  DEFAULT_NAME = 'Default'
13
13
  DEFAULT_TYPE = :direct
14
14
  SLASH = '/'
15
+ INSTRUMENTATION_NAME = NewRelic::Agent.base_name(name)
15
16
 
16
17
  def exchange_name(name)
17
18
  name.empty? ? DEFAULT_NAME : name
@@ -28,6 +29,8 @@ module NewRelic
28
29
  include Bunny
29
30
 
30
31
  def publish_with_tracing(payload, opts = {})
32
+ NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)
33
+
31
34
  begin
32
35
  destination = exchange_name(name)
33
36
 
@@ -62,6 +65,8 @@ module NewRelic
62
65
  include Bunny
63
66
 
64
67
  def pop_with_tracing
68
+ NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)
69
+
65
70
  bunny_error, delivery_info, message_properties, _payload = nil, nil, nil, nil
66
71
  begin
67
72
  t0 = Process.clock_gettime(Process::CLOCK_REALTIME)
@@ -104,6 +109,8 @@ module NewRelic
104
109
  end
105
110
 
106
111
  def purge_with_tracing
112
+ NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)
113
+
107
114
  begin
108
115
  type = server_named? ? :temporary_queue : :queue
109
116
  segment = NewRelic::Agent::Tracer.start_message_broker_segment(
@@ -129,6 +136,8 @@ module NewRelic
129
136
  include Bunny
130
137
 
131
138
  def call_with_tracing(*args)
139
+ NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)
140
+
132
141
  delivery_info, message_properties, _ = args
133
142
  queue_name = queue.respond_to?(:name) ? queue.name : queue
134
143
 
@@ -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
@@ -5,13 +5,12 @@
5
5
  module NewRelic::Agent::Instrumentation
6
6
  module ConcurrentRuby
7
7
  SEGMENT_NAME = 'Concurrent/Task'
8
- SUPPORTABILITY_METRIC = 'Supportability/ConcurrentRuby/Invoked'
8
+ INSTRUMENTATION_NAME = NewRelic::Agent.base_name(name)
9
9
 
10
- def add_task_tracing(*args, &task)
11
- NewRelic::Agent.record_metric_once(SUPPORTABILITY_METRIC)
10
+ def add_task_tracing(&task)
11
+ NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)
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