newrelic_rpm 9.2.0 → 9.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1eb606235173b437a2991d23d5f23b7715ab8025263f134f11454dcadf0bac9e
4
- data.tar.gz: 4e468d079bd47f57a7dd2185039dc15f29a139e278b5d133a5a0b08e301f85f0
3
+ metadata.gz: fd188401ae5aad975a09ff40578156c88aac17e12320f41ce4bee8149c769aaf
4
+ data.tar.gz: e32201ee58712dd1520f03ae23a46bd1c804c2991b835151a68643c00cf140e3
5
5
  SHA512:
6
- metadata.gz: 11835787018b19326041e1f10f8a72befeb8ba9345e793ceb30e4cbd57b6ffa678da13f833fe05f17148b8beb6e9e77f4dc2ab7eda573ecc4aa62060e71ee05b
7
- data.tar.gz: 1f0e60f9d9aef77edd656a6cc55b7e735cfbaf6a7006ed0724303b52d9cbb71bc740899de335ff45bece28f551bb0053a3077fee65863d5c355666c323150ac0
6
+ metadata.gz: cf9190f9bece2103511dc53071120f3dc758dba82cf042c1892d3376dc73a7b66e8898908bfe8406d85ba49ad67f7c6f5b2826e8e9b2a07d29ea05f5a99b701c
7
+ data.tar.gz: 5a240785708c245119750b33df64e5467e7f9b8abf9daae8b568a452da1913f40862788323232928ecc6da489fc7b998118f2397293a55e4d371e3f0a1ae0ad5
data/CHANGELOG.md CHANGED
@@ -1,15 +1,42 @@
1
1
  # New Relic Ruby Agent Release Notes
2
2
 
3
+ ## v9.2.2
4
+
5
+ Version 9.2.2 of the agent fixes a bug with the `Transaction#finished?` method.
6
+
7
+ - **Bugfix: Transaction#finished? no longer throws a NoMethodError when initial_segment is nil**
8
+
9
+ This change adds a safe navigation operator to `Transaction#finished?` to prevent `NoMethodErrors` when a transaction does not have any segments. Our thanks goes to [@JulienDefrance](https://github.com/JulienDefrance) for reporting this issue. [PR#1983](https://github.com/newrelic/newrelic-ruby-agent/pull/1983)
10
+
11
+ ## v9.2.1
12
+
13
+ Version 9.2.1 fixes a bug causing the agent to continue storing data on finished transactions, and a bug preventing errors from being expected.
14
+
15
+ - **Bugfix: Finished transactions continue to store data on different threads**
16
+
17
+ Previously, when a new thread was spawned the agent would continue using the current transaction to record data on, even if this transaction had finished already in a different thread. Now the agent will only use the current transaction in the new thread if it is not yet finished. Thank you to [@fcheung](https://github.com/fcheung) for reporting this bug and providing us with an extremely helpful reproduction to debug. [PR#1969](https://github.com/newrelic/newrelic-ruby-agent/pull/1969)
18
+
19
+
20
+ - **Bugfix: Expected Errors passed to notice_error are expected again**
21
+
22
+ A bug was introduced in 9.1.0 that caused to agent not to mark errors as expected if the error was passed in to `notice_error` using the `expected: true` parameter. This has been fixed and errors will now be marked as expected, as expected. Thank you very much to [@eiskrenkov](https://github.com/eiskrenkov) for finding this bug and contributing a fix for it! [PR#1954](https://github.com/newrelic/newrelic-ruby-agent/pull/1954)
23
+
24
+
25
+
3
26
  ## v9.2.0
4
27
 
5
28
  Version 9.2.0 of the agent introduces some performance improvements for working with high numbers of nested actions, and deprecates instrumentation for the `memcached` and `memcache-client` gems (with `dalli` still being supported).
6
29
 
7
30
  - **Feature: Enhance performance for handling high numbers of nested actions**
8
31
 
9
- With [Issue#1910](https://github.com/newrelic/newrelic-ruby-agent/issues/1910) community members [@parkerfinch](https://github.com/parkerfinch) and [@travisbell](https://github.com/travisbell) informed us of some CPU spikes and process hangs seen only when using the agent's thread instrumentation, which was enabled by default with v9.0. When thread instrumentation is enabled, instrumented actions taking place within threads are seen and reported on by the agent whereas they would have previously gone unnoticed. This is a great improvement to the agent's usefulness in an async context, and also makes it easier for higher numbers of nested actions to be observed.
10
- For example, if an instrumented background job framework (Sidekiq, Resque) kicks off a job that the agent notices and then that job in turn performs actions such as database queries that the agent also instruments, nested actions are seen. However, with very high (10,000+) numbers of actions nested within a single instrumented outer action, the agent would struggle to efficiently crunch through all of the collected data at the time when the outer action finished.
32
+ With [Issue#1910](https://github.com/newrelic/newrelic-ruby-agent/issues/1910) community members [@parkerfinch](https://github.com/parkerfinch) and [@travisbell](https://github.com/travisbell) informed us of some CPU spikes and process hangs seen only when using the agent's thread instrumentation, which was enabled by default with v9.0. When thread instrumentation is enabled, instrumented actions taking place within threads are seen and reported on by the agent whereas they would have previously gone unnoticed. This is a great improvement to the agent's usefulness in an async context, and also makes it easier for higher numbers of nested actions to be observed.
33
+ For example, if an instrumented background job framework (Sidekiq, Resque) kicks off a job that the agent notices and then that job in turn performs actions such as database queries that the agent also instruments, nested actions are seen. However, with very high (10,000+) numbers of actions nested within a single instrumented outer action, the agent would struggle to efficiently crunch through all of the collected data at the time when the outer action finished.
11
34
  The agent should now be much more efficient when any observed action with lots of nested actions is finished. Our performance testing was conducted with hundreds of thousands of nested actions taking place, and we hope that the benefits of thread tracing can now be enjoyed without any drawbacks. Thanks very much [@parkerfinch](https://github.com/parkerfinch) and [@travisbell](https://github.com/travisbell)! [PR#1927](https://github.com/newrelic/newrelic-ruby-agent/pull/1927)
12
35
 
36
+ - **Feature: The agent configuration will now reflect whether module prepending or method chaining was used for instrumentation**
37
+
38
+ For `:'instrumentation.*'` configuration parameters that are set to :auto (the default), the agent will automatically determine whether to use module prepending or method chaining. The agent will now update its in-memory configuration to give each relevant parameter a value of either :prepend or :chain so that the result of the determination can be introspected. This is intended to help 3rd party libraries that wish to further enhance the agent's instrumentation capabilities by prepending or chaining additional logic. Environment variable, YAML file, and server-side configuration based values are not impacted. [PR#1930](https://github.com/newrelic/newrelic-ruby-agent/pull/1930)
39
+
13
40
  - **Feature: Deprecate memcached and memcache-client instrumentation**
14
41
 
15
42
  Instrumentation for the memcached and memcache-client libraries is deprecated and will be removed during the next major release.
@@ -318,7 +318,7 @@ module NewRelic
318
318
  :public => true,
319
319
  :type => String,
320
320
  :allowed_from_server => false,
321
- :description => 'Your New Relic <LicenseKey />.'
321
+ :description => 'Your New Relic <InlinePopover type="licenseKey" />.'
322
322
  },
323
323
  :log_level => {
324
324
  :default => 'info',
@@ -353,7 +353,7 @@ module NewRelic
353
353
  :public => true,
354
354
  :type => String,
355
355
  :allowed_from_server => false,
356
- :description => 'Your New Relic [user key](/docs/apis/intro-apis/new-relic-api-keys/#overview-keys). Required when using the New Relic REST API v2 to record deployments using the `newrelic deployments` command.'
356
+ :description => 'Your New Relic <InlinePopover type="userKey" />. Required when using the New Relic REST API v2 to record deployments using the `newrelic deployments` command.'
357
357
  },
358
358
  :backport_fast_active_record_connection_lookup => {
359
359
  :default => false,
@@ -386,7 +386,7 @@ module NewRelic
386
386
  When `true`, the agent captures HTTP request parameters and attaches them to transaction traces, traced errors, and [`TransactionError` events](/attribute-dictionary?attribute_name=&events_tids%5B%5D=8241).
387
387
 
388
388
  <Callout variant="caution">
389
- When using the `capture_params` setting, the Ruby agent will not attempt to filter secret information. <b>Recommendation:</b> To filter secret information from request parameters, use the [`attributes.include` setting](/docs/agents/ruby-agent/attributes/enable-disable-attributes-ruby) instead. For more information, see the <a href="/docs/agents/ruby-agent/attributes/ruby-attribute-examples#ex_req_params">Ruby attribute examples</a>.
389
+ When using the `capture_params` setting, the Ruby agent will not attempt to filter secret information. `Recommendation:` To filter secret information from request parameters, use the [`attributes.include` setting](/docs/agents/ruby-agent/attributes/enable-disable-attributes-ruby) instead. For more information, see the <a href="/docs/agents/ruby-agent/attributes/ruby-attribute-examples#ex_req_params">Ruby attribute examples</a>.
390
390
  </Callout>
391
391
  DESCRIPTION
392
392
  },
@@ -402,7 +402,13 @@ module NewRelic
402
402
  :public => true,
403
403
  :type => String,
404
404
  :allowed_from_server => false,
405
- :description => 'Path to <b>newrelic.yml</b>. If undefined, the agent checks the following directories (in order): <b>config/newrelic.yml</b>, <b>newrelic.yml</b>, <b>$HOME/.newrelic/newrelic.yml</b> and <b>$HOME/newrelic.yml</b>.'
405
+ :description => <<~DESC
406
+ Path to `newrelic.yml`. If undefined, the agent checks the following directories (in order):
407
+ * `config/newrelic.yml`
408
+ * `newrelic.yml`
409
+ * `$HOME/.newrelic/newrelic.yml`
410
+ * `$HOME/newrelic.yml`
411
+ DESC
406
412
  },
407
413
  :'exclude_newrelic_header' => {
408
414
  :default => false,
@@ -622,7 +628,7 @@ module NewRelic
622
628
  :type => Boolean,
623
629
  :allowed_from_server => true,
624
630
  :dynamic_name => true,
625
- :description => 'If `true`, the agent collects [TransactionError events](/docs/insights/new-relic-insights/decorating-events/error-event-default-attributes-insights).'
631
+ :description => 'If `true`, the agent collects [`TransactionError` events](/docs/insights/new-relic-insights/decorating-events/error-event-default-attributes-insights).'
626
632
  },
627
633
  :'error_collector.enabled' => {
628
634
  :default => true,
@@ -702,7 +708,7 @@ module NewRelic
702
708
  :public => true,
703
709
  :type => Integer,
704
710
  :allowed_from_server => true,
705
- :description => 'Defines the maximum number of [TransactionError events](/docs/insights/new-relic-insights/decorating-events/error-event-default-attributes-insights) reported per harvest cycle.'
711
+ :description => 'Defines the maximum number of [`TransactionError` events](/docs/insights/new-relic-insights/decorating-events/error-event-default-attributes-insights) reported per harvest cycle.'
706
712
  },
707
713
  # Browser monitoring
708
714
  :'browser_monitoring.auto_instrument' => {
@@ -941,7 +947,7 @@ module NewRelic
941
947
  :type => Array,
942
948
  :allowed_from_server => false,
943
949
  :transform => DefaultSource.method(:convert_to_regexp_list),
944
- :description => 'List of allowed endpoints to include in audit log'
950
+ :description => 'List of allowed endpoints to include in audit log.'
945
951
  },
946
952
  :'audit_log.path' => {
947
953
  :default => DefaultSource.audit_log_path,
@@ -957,21 +963,21 @@ module NewRelic
957
963
  :public => true,
958
964
  :type => String,
959
965
  :allowed_from_server => false,
960
- :description => 'Specify a list of constants that should prevent the agent from starting automatically. Separate individual constants with a comma `,`. For example, `Rails::Console,UninstrumentedBackgroundJob`.'
966
+ :description => 'Specify a list of constants that should prevent the agent from starting automatically. Separate individual constants with a comma `,`. For example, `"Rails::Console,UninstrumentedBackgroundJob"`.'
961
967
  },
962
968
  :'autostart.denylisted_executables' => {
963
969
  :default => 'irb,rspec',
964
970
  :public => true,
965
971
  :type => String,
966
972
  :allowed_from_server => false,
967
- :description => 'Defines a comma-delimited list of executables that the agent should not instrument. For example, `rake,my_ruby_script.rb`.'
973
+ :description => 'Defines a comma-delimited list of executables that the agent should not instrument. For example, `"rake,my_ruby_script.rb"`.'
968
974
  },
969
975
  :'autostart.denylisted_rake_tasks' => {
970
976
  :default => AUTOSTART_DENYLISTED_RAKE_TASKS,
971
977
  :public => true,
972
978
  :type => String,
973
979
  :allowed_from_server => false,
974
- :description => 'Defines a comma-delimited list of Rake tasks that the agent should not instrument. For example, `assets:precompile,db:migrate`.'
980
+ :description => 'Defines a comma-delimited list of Rake tasks that the agent should not instrument. For example, `"assets:precompile,db:migrate"`.'
975
981
  },
976
982
  # Code level metrics
977
983
  :'code_level_metrics.enabled' => {
@@ -1135,7 +1141,7 @@ module NewRelic
1135
1141
  :public => true,
1136
1142
  :type => Boolean,
1137
1143
  :allowed_from_server => false,
1138
- :description => 'If `true`, disables the use of GC::Profiler to measure time spent in garbage collection'
1144
+ :description => 'If `true`, disables the use of `GC::Profiler` to measure time spent in garbage collection'
1139
1145
  },
1140
1146
  :disable_memory_sampler => {
1141
1147
  :default => false,
@@ -1150,7 +1156,7 @@ module NewRelic
1150
1156
  :public => true,
1151
1157
  :type => Boolean,
1152
1158
  :allowed_from_server => false,
1153
- :description => 'If `true`, the agent won\'t wrap third-party middlewares in instrumentation (regardless of whether they are installed via Rack::Builder or Rails).'
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).'
1154
1160
  },
1155
1161
  :disable_samplers => {
1156
1162
  :default => false,
@@ -1186,7 +1192,7 @@ module NewRelic
1186
1192
 
1187
1193
  To continue using cross application tracing, update the following options in your `newrelic.yml` configuration file:
1188
1194
 
1189
- ```
1195
+ ```yaml
1190
1196
  # newrelic.yml
1191
1197
 
1192
1198
  cross_application_tracer:
@@ -1249,7 +1255,7 @@ module NewRelic
1249
1255
  :type => Array,
1250
1256
  :allowed_from_server => false,
1251
1257
  :transform => DefaultSource.method(:convert_to_list),
1252
- :description => 'Ordinarily the agent reports dyno names with a trailing dot and process ID (for example, <b>worker.3</b>). You can remove this trailing data by specifying the prefixes you want to report without trailing data (for example, <b>worker</b>).'
1258
+ :description => 'Ordinarily the agent reports dyno names with a trailing dot and process ID (for example, `worker.3`). You can remove this trailing data by specifying the prefixes you want to report without trailing data (for example, `worker`).'
1253
1259
  },
1254
1260
  # Infinite tracing
1255
1261
  :'infinite_tracing.trace_observer.host' => {
@@ -1279,7 +1285,7 @@ module NewRelic
1279
1285
  :public => true,
1280
1286
  :type => String,
1281
1287
  :allowed_from_server => false,
1282
- :description => 'Controls auto-instrumentation of ActiveSupport::Logger at start up. May be one of [auto|prepend|chain|disabled].'
1288
+ :description => 'Controls auto-instrumentation of `ActiveSupport::Logger` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1283
1289
  },
1284
1290
  :'instrumentation.bunny' => {
1285
1291
  :default => 'auto',
@@ -1287,7 +1293,7 @@ module NewRelic
1287
1293
  :type => String,
1288
1294
  :dynamic_name => true,
1289
1295
  :allowed_from_server => false,
1290
- :description => 'Controls auto-instrumentation of bunny at start up. May be one of [auto|prepend|chain|disabled].'
1296
+ :description => 'Controls auto-instrumentation of bunny at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1291
1297
  },
1292
1298
  :'instrumentation.fiber' => {
1293
1299
  :default => 'auto',
@@ -1295,7 +1301,7 @@ module NewRelic
1295
1301
  :type => String,
1296
1302
  :dynamic_name => true,
1297
1303
  :allowed_from_server => false,
1298
- :description => 'Controls auto-instrumentation of the Fiber class at start up. May be one of [auto|prepend|chain|disabled].'
1304
+ :description => 'Controls auto-instrumentation of the Fiber class at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1299
1305
  },
1300
1306
  :'instrumentation.concurrent_ruby' => {
1301
1307
  :default => 'auto',
@@ -1303,7 +1309,7 @@ module NewRelic
1303
1309
  :type => String,
1304
1310
  :dynamic_name => true,
1305
1311
  :allowed_from_server => false,
1306
- :description => 'Controls auto-instrumentation of the concurrent-ruby library at start up. May be one of [auto|prepend|chain|disabled].'
1312
+ :description => 'Controls auto-instrumentation of the concurrent-ruby library at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1307
1313
  },
1308
1314
  :'instrumentation.curb' => {
1309
1315
  :default => 'auto',
@@ -1312,7 +1318,7 @@ module NewRelic
1312
1318
  :type => String,
1313
1319
  :dynamic_name => true,
1314
1320
  :allowed_from_server => false,
1315
- :description => 'Controls auto-instrumentation of Curb at start up. May be one of [auto|prepend|chain|disabled].'
1321
+ :description => 'Controls auto-instrumentation of Curb at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1316
1322
  },
1317
1323
  :'instrumentation.delayed_job' => {
1318
1324
  :default => 'auto',
@@ -1321,7 +1327,7 @@ module NewRelic
1321
1327
  :type => String,
1322
1328
  :dynamic_name => true,
1323
1329
  :allowed_from_server => false,
1324
- :description => 'Controls auto-instrumentation of Delayed Job at start up. May be one of [auto|prepend|chain|disabled].'
1330
+ :description => 'Controls auto-instrumentation of Delayed Job at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1325
1331
  },
1326
1332
  :'instrumentation.elasticsearch' => {
1327
1333
  :default => 'auto',
@@ -1329,7 +1335,7 @@ module NewRelic
1329
1335
  :type => String,
1330
1336
  :dynamic_name => true,
1331
1337
  :allowed_from_server => false,
1332
- :description => 'Controls auto-instrumentation of the elasticsearch library at start up. May be one of [auto|prepend|chain|disabled].'
1338
+ :description => 'Controls auto-instrumentation of the elasticsearch library at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1333
1339
  },
1334
1340
  :'instrumentation.excon' => {
1335
1341
  :default => 'enabled',
@@ -1338,7 +1344,7 @@ module NewRelic
1338
1344
  :type => String,
1339
1345
  :dynamic_name => true,
1340
1346
  :allowed_from_server => false,
1341
- :description => 'Controls auto-instrumentation of Excon at start up. May be one of [enabled|disabled].'
1347
+ :description => 'Controls auto-instrumentation of Excon at start up. May be one of: `enabled`, `disabled`.'
1342
1348
  },
1343
1349
  :'instrumentation.grape' => {
1344
1350
  :default => 'auto',
@@ -1346,7 +1352,7 @@ module NewRelic
1346
1352
  :type => String,
1347
1353
  :dynamic_name => true,
1348
1354
  :allowed_from_server => false,
1349
- :description => 'Controls auto-instrumentation of Grape at start up. May be one of [auto|prepend|chain|disabled].'
1355
+ :description => 'Controls auto-instrumentation of Grape at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1350
1356
  },
1351
1357
  :'instrumentation.grpc_client' => {
1352
1358
  :default => 'auto',
@@ -1355,7 +1361,7 @@ module NewRelic
1355
1361
  :type => String,
1356
1362
  :dynamic_name => true,
1357
1363
  :allowed_from_server => false,
1358
- :description => 'Controls auto-instrumentation of gRPC clients at start up. May be one of [auto|prepend|chain|disabled].'
1364
+ :description => 'Controls auto-instrumentation of gRPC clients at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1359
1365
  },
1360
1366
  :'instrumentation.grpc.host_denylist' => {
1361
1367
  :default => [],
@@ -1363,7 +1369,7 @@ module NewRelic
1363
1369
  :type => Array,
1364
1370
  :allowed_from_server => false,
1365
1371
  :transform => DefaultSource.method(:convert_to_regexp_list),
1366
- :description => %Q(Specifies a list of hostname patterns separated by commas that will match gRPC hostnames that traffic is to be ignored by New Relic for. New Relic's gRPC client instrumentation will ignore traffic streamed to a host matching any of these patterns, and New Relic's gRPC server instrumentation will ignore traffic for a server running on a host whose hostname matches any of these patterns. By default, no traffic is ignored when gRPC instrumentation is itself enabled. For example, "private.com$,exception.*")
1372
+ :description => %Q(Specifies a list of hostname patterns separated by commas that will match gRPC hostnames that traffic is to be ignored by New Relic for. New Relic's gRPC client instrumentation will ignore traffic streamed to a host matching any of these patterns, and New Relic's gRPC server instrumentation will ignore traffic for a server running on a host whose hostname matches any of these patterns. By default, no traffic is ignored when gRPC instrumentation is itself enabled. For example, `"private.com$,exception.*"`)
1367
1373
  },
1368
1374
  :'instrumentation.grpc_server' => {
1369
1375
  :default => 'auto',
@@ -1372,7 +1378,7 @@ module NewRelic
1372
1378
  :type => String,
1373
1379
  :dynamic_name => true,
1374
1380
  :allowed_from_server => false,
1375
- :description => 'Controls auto-instrumentation of gRPC servers at start up. May be one of [auto|prepend|chain|disabled].'
1381
+ :description => 'Controls auto-instrumentation of gRPC servers at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1376
1382
  },
1377
1383
  :'instrumentation.httpclient' => {
1378
1384
  :default => 'auto',
@@ -1381,7 +1387,7 @@ module NewRelic
1381
1387
  :type => String,
1382
1388
  :dynamic_name => true,
1383
1389
  :allowed_from_server => false,
1384
- :description => 'Controls auto-instrumentation of HTTPClient at start up. May be one of [auto|prepend|chain|disabled].'
1390
+ :description => 'Controls auto-instrumentation of HTTPClient at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1385
1391
  },
1386
1392
  :'instrumentation.httprb' => {
1387
1393
  :default => 'auto',
@@ -1390,7 +1396,7 @@ module NewRelic
1390
1396
  :type => String,
1391
1397
  :dynamic_name => true,
1392
1398
  :allowed_from_server => false,
1393
- :description => 'Controls auto-instrumentation of http.rb gem at start up. May be one of [auto|prepend|chain|disabled].'
1399
+ :description => 'Controls auto-instrumentation of http.rb gem at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1394
1400
  },
1395
1401
  :'instrumentation.logger' => {
1396
1402
  :default => instrumentation_value_from_boolean(:'application_logging.enabled'),
@@ -1399,7 +1405,7 @@ module NewRelic
1399
1405
  :type => String,
1400
1406
  :dynamic_name => true,
1401
1407
  :allowed_from_server => false,
1402
- :description => 'Controls auto-instrumentation of Ruby standard library Logger at start up. May be one of [auto|prepend|chain|disabled].'
1408
+ :description => 'Controls auto-instrumentation of Ruby standard library Logger at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1403
1409
  },
1404
1410
  :'instrumentation.memcache' => {
1405
1411
  :default => 'auto',
@@ -1407,7 +1413,7 @@ module NewRelic
1407
1413
  :type => String,
1408
1414
  :dynamic_name => true,
1409
1415
  :allowed_from_server => false,
1410
- :description => 'Controls auto-instrumentation of dalli gem for Memcache at start up. May be one of [auto|prepend|chain|disabled].'
1416
+ :description => 'Controls auto-instrumentation of dalli gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1411
1417
  },
1412
1418
  :'instrumentation.memcached' => {
1413
1419
  :default => 'auto',
@@ -1416,7 +1422,7 @@ module NewRelic
1416
1422
  :type => String,
1417
1423
  :dynamic_name => true,
1418
1424
  :allowed_from_server => false,
1419
- :description => 'Controls auto-instrumentation of memcached gem for Memcache at start up. May be one of [auto|prepend|chain|disabled].'
1425
+ :description => 'Controls auto-instrumentation of memcached gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1420
1426
  },
1421
1427
  :'instrumentation.memcache_client' => {
1422
1428
  :default => 'auto',
@@ -1425,7 +1431,7 @@ module NewRelic
1425
1431
  :type => String,
1426
1432
  :dynamic_name => true,
1427
1433
  :allowed_from_server => false,
1428
- :description => 'Controls auto-instrumentation of memcache-client gem for Memcache at start up. May be one of [auto|prepend|chain|disabled].'
1434
+ :description => 'Controls auto-instrumentation of memcache-client gem for Memcache at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1429
1435
  },
1430
1436
  :'instrumentation.mongo' => {
1431
1437
  :default => 'enabled',
@@ -1434,7 +1440,7 @@ module NewRelic
1434
1440
  :type => String,
1435
1441
  :dynamic_name => true,
1436
1442
  :allowed_from_server => false,
1437
- :description => 'Controls auto-instrumentation of Mongo at start up. May be one of [enabled|disabled].'
1443
+ :description => 'Controls auto-instrumentation of Mongo at start up. May be one of: `enabled`, `disabled`.'
1438
1444
  },
1439
1445
  :'instrumentation.net_http' => {
1440
1446
  :default => 'auto',
@@ -1443,7 +1449,7 @@ module NewRelic
1443
1449
  :type => String,
1444
1450
  :dynamic_name => true,
1445
1451
  :allowed_from_server => false,
1446
- :description => 'Controls auto-instrumentation of Net::HTTP at start up. May be one of [auto|prepend|chain|disabled].'
1452
+ :description => 'Controls auto-instrumentation of `Net::HTTP` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1447
1453
  },
1448
1454
  :'instrumentation.puma_rack' => {
1449
1455
  :default => value_of(:'instrumentation.rack'),
@@ -1452,9 +1458,9 @@ module NewRelic
1452
1458
  :type => String,
1453
1459
  :dynamic_name => true,
1454
1460
  :allowed_from_server => false,
1455
- :description => 'Controls auto-instrumentation of Puma::Rack. When enabled, the agent hooks into the ' \
1456
- '`to_app` method in Puma::Rack::Builder to find gems to instrument during ' \
1457
- 'application startup. May be one of [auto|prepend|chain|disabled].'
1461
+ :description => 'Controls auto-instrumentation of `Puma::Rack`. When enabled, the agent hooks into the ' \
1462
+ '`to_app` method in `Puma::Rack::Builder` to find gems to instrument during ' \
1463
+ 'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1458
1464
  },
1459
1465
  :'instrumentation.puma_rack_urlmap' => {
1460
1466
  :default => value_of(:'instrumentation.rack_urlmap'),
@@ -1463,7 +1469,7 @@ module NewRelic
1463
1469
  :type => String,
1464
1470
  :dynamic_name => true,
1465
1471
  :allowed_from_server => false,
1466
- :description => 'Controls auto-instrumentation of Puma::Rack::URLMap at start up. May be one of [auto|prepend|chain|disabled].'
1472
+ :description => 'Controls auto-instrumentation of `Puma::Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1467
1473
  },
1468
1474
  :'instrumentation.rack' => {
1469
1475
  :default => 'auto',
@@ -1473,8 +1479,8 @@ module NewRelic
1473
1479
  :dynamic_name => true,
1474
1480
  :allowed_from_server => false,
1475
1481
  :description => 'Controls auto-instrumentation of Rack. When enabled, the agent hooks into the ' \
1476
- '`to_app` method in Rack::Builder to find gems to instrument during ' \
1477
- 'application startup. May be one of [auto|prepend|chain|disabled].'
1482
+ '`to_app` method in `Rack::Builder` to find gems to instrument during ' \
1483
+ 'application startup. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1478
1484
  },
1479
1485
  :'instrumentation.rack_urlmap' => {
1480
1486
  :default => 'auto',
@@ -1483,7 +1489,7 @@ module NewRelic
1483
1489
  :type => String,
1484
1490
  :dynamic_name => true,
1485
1491
  :allowed_from_server => false,
1486
- :description => 'Controls auto-instrumentation of Rack::URLMap at start up. May be one of [auto|prepend|chain|disabled].'
1492
+ :description => 'Controls auto-instrumentation of `Rack::URLMap` at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1487
1493
  },
1488
1494
  :'instrumentation.rake' => {
1489
1495
  :default => 'auto',
@@ -1491,7 +1497,7 @@ module NewRelic
1491
1497
  :type => String,
1492
1498
  :dynamic_name => true,
1493
1499
  :allowed_from_server => false,
1494
- :description => 'Controls auto-instrumentation of rake at start up. May be one of [auto|prepend|chain|disabled].'
1500
+ :description => 'Controls auto-instrumentation of rake at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1495
1501
  },
1496
1502
  :'instrumentation.redis' => {
1497
1503
  :default => 'auto',
@@ -1499,7 +1505,7 @@ module NewRelic
1499
1505
  :type => String,
1500
1506
  :dynamic_name => true,
1501
1507
  :allowed_from_server => false,
1502
- :description => 'Controls auto-instrumentation of Redis at start up. May be one of [auto|prepend|chain|disabled].'
1508
+ :description => 'Controls auto-instrumentation of Redis at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1503
1509
  },
1504
1510
  :'instrumentation.resque' => {
1505
1511
  :default => 'auto',
@@ -1508,7 +1514,7 @@ module NewRelic
1508
1514
  :type => String,
1509
1515
  :dynamic_name => true,
1510
1516
  :allowed_from_server => false,
1511
- :description => 'Controls auto-instrumentation of resque at start up. May be one of [auto|prepend|chain|disabled].'
1517
+ :description => 'Controls auto-instrumentation of resque at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1512
1518
  },
1513
1519
  :'instrumentation.sinatra' => {
1514
1520
  :default => 'auto',
@@ -1516,7 +1522,7 @@ module NewRelic
1516
1522
  :type => String,
1517
1523
  :dynamic_name => true,
1518
1524
  :allowed_from_server => false,
1519
- :description => 'Controls auto-instrumentation of Sinatra at start up. May be one of [auto|prepend|chain|disabled].'
1525
+ :description => 'Controls auto-instrumentation of Sinatra at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1520
1526
  },
1521
1527
  :'instrumentation.thread' => {
1522
1528
  :default => 'auto',
@@ -1524,7 +1530,7 @@ module NewRelic
1524
1530
  :type => String,
1525
1531
  :dynamic_name => true,
1526
1532
  :allowed_from_server => false,
1527
- :description => 'Controls auto-instrumentation of the Thread class at start up to allow the agent to correctly nest spans inside of an asynchronous transaction. This does not enable the agent to automatically trace all threads created (see `instrumentation.thread.tracing`). May be one of [auto|prepend|chain|disabled].'
1533
+ :description => 'Controls auto-instrumentation of the Thread class at start up to allow the agent to correctly nest spans inside of an asynchronous transaction. This does not enable the agent to automatically trace all threads created (see `instrumentation.thread.tracing`). May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1528
1534
  },
1529
1535
  :'instrumentation.thread.tracing' => {
1530
1536
  :default => true,
@@ -1546,7 +1552,7 @@ module NewRelic
1546
1552
  :type => String,
1547
1553
  :dynamic_name => true,
1548
1554
  :allowed_from_server => false,
1549
- :description => 'Controls auto-instrumentation of the Tilt template rendering library at start up. May be one of [auto|prepend|chain|disabled].'
1555
+ :description => 'Controls auto-instrumentation of the Tilt template rendering library at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1550
1556
  },
1551
1557
  :'instrumentation.typhoeus' => {
1552
1558
  :default => 'auto',
@@ -1555,7 +1561,7 @@ module NewRelic
1555
1561
  :type => String,
1556
1562
  :dynamic_name => true,
1557
1563
  :allowed_from_server => false,
1558
- :description => 'Controls auto-instrumentation of Typhoeus at start up. May be one of [auto|prepend|chain|disabled].'
1564
+ :description => 'Controls auto-instrumentation of Typhoeus at start up. May be one of: `auto`, `prepend`, `chain`, `disabled`.'
1559
1565
  },
1560
1566
  # Message tracer
1561
1567
  :'message_tracer.segment_parameters.enabled' => {
@@ -1663,14 +1669,14 @@ module NewRelic
1663
1669
  :public => true,
1664
1670
  :type => String,
1665
1671
  :allowed_from_server => true,
1666
- :description => 'Defines an obfuscation level for slow SQL queries. Valid options are `obfuscated`, `raw`, or `none`).'
1672
+ :description => 'Defines an obfuscation level for slow SQL queries. Valid options are `obfuscated`, `raw`, or `none`.'
1667
1673
  },
1668
1674
  :'slow_sql.use_longer_sql_id' => {
1669
1675
  :default => false,
1670
1676
  :public => true,
1671
1677
  :type => Boolean,
1672
1678
  :allowed_from_server => true,
1673
- :description => 'Generate a longer sql_id for slow SQL traces. sql_id is used for aggregation of similar queries.'
1679
+ :description => 'Generate a longer `sql_id` for slow SQL traces. `sql_id` is used for aggregation of similar queries.'
1674
1680
  },
1675
1681
  # Span events
1676
1682
  :'span_events.enabled' => {
@@ -1693,7 +1699,7 @@ module NewRelic
1693
1699
  :public => true,
1694
1700
  :type => Integer,
1695
1701
  :allowed_from_server => true,
1696
- :description => 'Defines the maximum number of span events reported from a single harvest. Any Integer between 1 and 10000 is valid.'
1702
+ :description => 'Defines the maximum number of span events reported from a single harvest. Any Integer between `1` and `10000` is valid.'
1697
1703
  },
1698
1704
  # Strip exception messages
1699
1705
  :'strip_exception_messages.enabled' => {
@@ -2001,8 +2007,8 @@ module NewRelic
2001
2007
  :type => Boolean,
2002
2008
  :allowed_from_server => false,
2003
2009
  :external => :infinite_tracing,
2004
- :description => "If `true` (the default), data sent to the trace observer is batched\ninstead of sending " \
2005
- 'each span individually.'
2010
+ :description => 'If `true` (the default), data sent to the trace observer is batched instead of ' \
2011
+ 'sending each span individually.'
2006
2012
  },
2007
2013
  :'infinite_tracing.compression_level' => {
2008
2014
  :default => :high,
@@ -2010,8 +2016,13 @@ module NewRelic
2010
2016
  :type => Symbol,
2011
2017
  :allowed_from_server => false,
2012
2018
  :external => :infinite_tracing,
2013
- :description => "Configure the compression level for data sent to the trace observer\nMay be one of " \
2014
- "[none|low|medium|high]\n'high' is the default. Set the level to 'none' to disable compression"
2019
+ :description => <<~DESC
2020
+ Configure the compression level for data sent to the trace observer.
2021
+
2022
+ May be one of: `:none`, `:low`, `:medium`, `:high`.
2023
+
2024
+ Set the level to `:none` to disable compression.
2025
+ DESC
2015
2026
  },
2016
2027
  :js_agent_file => {
2017
2028
  :default => '',
@@ -15,6 +15,8 @@ module NewRelic
15
15
  module Agent
16
16
  module Configuration
17
17
  class Manager
18
+ DEPENDENCY_DETECTION_VALUES = %i[prepend chain].freeze
19
+
18
20
  # Defining these explicitly saves object allocations that we incur
19
21
  # if we use Forwardable and def_delegators.
20
22
  def [](key)
@@ -357,7 +359,18 @@ module NewRelic
357
359
  reset_cache
358
360
  end
359
361
 
362
+ # reset the configuration hash, but do not replace previously auto
363
+ # determined dependency detection values with nil or 'auto'
360
364
  def reset_cache
365
+ return new_cache unless defined?(@cache) && @cache
366
+
367
+ preserved = @cache.select { |_k, v| DEPENDENCY_DETECTION_VALUES.include?(v) }
368
+ new_cache
369
+ preserved.each { |k, v| @cache[k] = v unless @cache[k] && @cache[k] != 'auto' }
370
+ @cache
371
+ end
372
+
373
+ def new_cache
361
374
  @cache = Hash.new { |hash, key| hash[key] = self.fetch(key) }
362
375
  end
363
376
 
@@ -277,7 +277,7 @@ module NewRelic
277
277
  noticed_error.line_number = sense_method(exception, :line_number)
278
278
  noticed_error.stack_trace = truncate_trace(extract_stack_trace(exception))
279
279
 
280
- noticed_error.expected = !options.delete(:expected).nil? || expected?(exception)
280
+ noticed_error.expected = !!options.delete(:expected) || expected?(exception) # rubocop:disable Style/DoubleNegation
281
281
 
282
282
  noticed_error.attributes_from_notice_error = options.delete(:custom_params) || {}
283
283
 
@@ -424,7 +424,7 @@ module NewRelic
424
424
  current_txn = ::Thread.current[:newrelic_tracer_state]&.current_transaction if ::Thread.current[:newrelic_tracer_state]&.is_execution_traced?
425
425
  proc do
426
426
  begin
427
- if current_txn
427
+ if current_txn && !current_txn.finished?
428
428
  NewRelic::Agent::Tracer.state.current_transaction = current_txn
429
429
  current_txn.async = true
430
430
  segment_name += "/Thread#{::Thread.current.object_id}/Fiber#{::Fiber.current.object_id}" if NewRelic::Agent.config[:'thread_ids_enabled']
@@ -29,6 +29,12 @@ module NewRelic
29
29
  else
30
30
  segment.record_on_finish = true
31
31
  ::NewRelic::Agent.logger.debug("Segment limit of #{segment_limit} reached, ceasing collection.")
32
+
33
+ if finished?
34
+ ::NewRelic::Agent.logger.debug("Transaction #{best_name} has finished but segments still being created, resetting state.")
35
+ NewRelic::Agent::Tracer.state.reset
36
+ NewRelic::Agent.record_metric('Supportability/Transaction/SegmentLimitReachedAfterFinished/ResetState', 1)
37
+ end
32
38
  end
33
39
  segment.transaction_assigned
34
40
  end
@@ -439,6 +439,10 @@ module NewRelic
439
439
  segments.first
440
440
  end
441
441
 
442
+ def finished?
443
+ initial_segment&.finished?
444
+ end
445
+
442
446
  def create_initial_segment(options = {})
443
447
  segment = create_segment(@default_name, options)
444
448
  segment.record_scoped_metric = false
@@ -62,7 +62,6 @@ module NewRelic
62
62
  File.join(instrumentation_path, app.to_s, '*.rb')
63
63
  @instrumentation_files.each { |pattern| load_instrumentation_files(pattern) }
64
64
  DependencyDetection.detect!
65
- ruby_deprecation
66
65
  rails_32_deprecation
67
66
  ::NewRelic::Agent.logger.info('Finished instrumentation')
68
67
  end
@@ -81,19 +80,6 @@ module NewRelic
81
80
  )
82
81
  end
83
82
 
84
- def ruby_deprecation
85
- return unless RUBY_VERSION < '2.4.0'
86
-
87
- deprecation_msg = 'The Ruby Agent is dropping support for Rubies below 2.4 ' \
88
- 'in version 9.0.0. Please upgrade your Ruby version to continue receiving support. ' \
89
-
90
- ::NewRelic::Agent.logger.log_once(
91
- :warn,
92
- :deprecated_ruby_version,
93
- deprecation_msg
94
- )
95
- end
96
-
97
83
  include Instrumentation
98
84
  end
99
85
  end
@@ -179,6 +179,15 @@ module DependencyDetection
179
179
  return valid_value
180
180
  end
181
181
 
182
+ # update any :auto config value to be either :prepend or :chain after auto
183
+ # determination has selected one of those to use
184
+ def update_config_value(use_prepend)
185
+ if config_key && auto_configured?
186
+ NewRelic::Agent.config.instance_variable_get(:@cache)[config_key] = use_prepend ? :prepend : :chain
187
+ end
188
+ use_prepend
189
+ end
190
+
182
191
  def config_value
183
192
  return AUTO_CONFIG_VALUE unless config_key
184
193
 
@@ -202,7 +211,7 @@ module DependencyDetection
202
211
  end
203
212
 
204
213
  def use_prepend?
205
- prepend_configured? || (auto_configured? && !prepend_conflicts?)
214
+ update_config_value(prepend_configured? || (auto_configured? && !prepend_conflicts?))
206
215
  end
207
216
 
208
217
  def prepend_conflicts?
@@ -7,7 +7,7 @@ module NewRelic
7
7
  module VERSION # :nodoc:
8
8
  MAJOR = 9
9
9
  MINOR = 2
10
- TINY = 0
10
+ TINY = 2
11
11
 
12
12
  STRING = "#{MAJOR}.#{MINOR}.#{TINY}"
13
13
  end
data/newrelic.yml CHANGED
@@ -352,7 +352,7 @@ common: &default_settings
352
352
 
353
353
  # Controls auto-instrumentation of Excon at start up.
354
354
  # May be one of [enabled|disabled].
355
- # instrumentation.excon: auto
355
+ # instrumentation.excon: enabled
356
356
 
357
357
  # Controls auto-instrumentation of Grape at start up.
358
358
  # May be one of [auto|prepend|chain|disabled].
@@ -388,7 +388,7 @@ common: &default_settings
388
388
 
389
389
  # Controls auto-instrumentation of Mongo at start up.
390
390
  # May be one of [enabled|disabled].
391
- # instrumentation.mongo: auto
391
+ # instrumentation.mongo: enabled
392
392
 
393
393
  # Controls auto-instrumentation of Net::HTTP at start up.
394
394
  # May be one of [auto|prepend|chain|disabled].
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.2.0
4
+ version: 9.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanna McClure
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-04-17 00:00:00.000000000 Z
14
+ date: 2023-05-01 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler