newrelic_rpm 9.1.0 → 9.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -65
  3. data/.simplecov +1 -0
  4. data/Brewfile +1 -0
  5. data/CHANGELOG.md +33 -0
  6. data/Guardfile +1 -0
  7. data/bin/newrelic +1 -0
  8. data/bin/newrelic_cmd +1 -0
  9. data/lib/new_relic/agent/configuration/default_source.rb +69 -82
  10. data/lib/new_relic/agent/configuration/manager.rb +13 -0
  11. data/lib/new_relic/agent/error_collector.rb +1 -1
  12. data/lib/new_relic/agent/instrumentation/active_merchant.rb +3 -3
  13. data/lib/new_relic/agent/instrumentation/bunny/chain.rb +1 -1
  14. data/lib/new_relic/agent/instrumentation/bunny.rb +1 -1
  15. data/lib/new_relic/agent/instrumentation/delayed_job/chain.rb +1 -0
  16. data/lib/new_relic/agent/instrumentation/elasticsearch/chain.rb +1 -1
  17. data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +1 -0
  18. data/lib/new_relic/agent/instrumentation/elasticsearch.rb +1 -1
  19. data/lib/new_relic/agent/instrumentation/fiber/chain.rb +1 -1
  20. data/lib/new_relic/agent/instrumentation/fiber.rb +1 -1
  21. data/lib/new_relic/agent/instrumentation/grpc/client/chain.rb +1 -1
  22. data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +1 -1
  23. data/lib/new_relic/agent/instrumentation/grpc/client/prepend.rb +1 -1
  24. data/lib/new_relic/agent/instrumentation/grpc/client/request_wrapper.rb +1 -1
  25. data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +1 -1
  26. data/lib/new_relic/agent/instrumentation/grpc_client.rb +1 -1
  27. data/lib/new_relic/agent/instrumentation/grpc_server.rb +1 -1
  28. data/lib/new_relic/agent/instrumentation/memcache/dalli.rb +3 -1
  29. data/lib/new_relic/agent/instrumentation/memcache/prepend.rb +3 -1
  30. data/lib/new_relic/agent/instrumentation/memcache.rb +2 -2
  31. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +1 -1
  32. data/lib/new_relic/agent/instrumentation/sidekiq.rb +1 -0
  33. data/lib/new_relic/agent/method_tracer.rb +1 -1
  34. data/lib/new_relic/agent/new_relic_service.rb +0 -1
  35. data/lib/new_relic/agent/sampler.rb +1 -0
  36. data/lib/new_relic/agent/tracer.rb +1 -1
  37. data/lib/new_relic/agent/transaction/abstract_segment.rb +45 -39
  38. data/lib/new_relic/agent/transaction/distributed_tracing.rb +7 -8
  39. data/lib/new_relic/agent/transaction/tracing.rb +6 -0
  40. data/lib/new_relic/agent/transaction.rb +4 -0
  41. data/lib/new_relic/control/instrumentation.rb +0 -14
  42. data/lib/new_relic/dependency_detection.rb +10 -1
  43. data/lib/new_relic/version.rb +2 -2
  44. data/lib/tasks/coverage_report.rake +1 -1
  45. data/lib/tasks/instrumentation_generator/instrumentation.thor +8 -8
  46. data/lib/tasks/instrumentation_generator/templates/chain.tt +1 -1
  47. data/lib/tasks/instrumentation_generator/templates/dependency_detection.tt +1 -1
  48. data/lib/tasks/multiverse.rb +1 -0
  49. data/lib/tasks/newrelic.rb +1 -0
  50. data/newrelic.yml +5 -5
  51. metadata +73 -4
  52. data/lib/new_relic/agent/range_extensions.rb +0 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86b089be72e8fdf6af07082365c42ecfcbc6cc0c88df45cbac8238dca375af9c
4
- data.tar.gz: e41f270e6d423755657678a0211cab7cb2a294d7f514d486b447b4c09c650fd7
3
+ metadata.gz: 24d17293feea3a15b482164d50f81a2f90a5540f25fee4d90e8472c1eb9d2f14
4
+ data.tar.gz: f8a2475b3a782c509dd417a7174b3067da223bc834236c97a99456bb96660ecc
5
5
  SHA512:
6
- metadata.gz: f58684a973dd62ac5fb9b50309fd9ffc71ad2d14d2120902c8de8a3c1647abc99c376caeec6955708c5bbbc6989c687b753684523e02a0624dccc0a894285380
7
- data.tar.gz: 4e6e538da76646d35f55af94bc037603cf3bb643396a21304ddc887d56d02802cd36a50aaaeafad03ea4c1f579248710919eff2e458b78d610c5820e219d8f34
6
+ metadata.gz: 6b2673019061b94d7800b6025ab88c9f6f096322f1309f3fac2d08c999731574f76997782b603327c4e2cb8ced6b45bfb02e47c2086f575dffe839607a8c92de
7
+ data.tar.gz: 7f7d7e8f5982346f59d22a19bfdabacbbf5a57fd907cc694078534ff45e1cadeaee8631d2a110a64e06874f94258cf0050c15534a9d5482f13fe295005fb22e9
data/.rubocop.yml CHANGED
@@ -6,7 +6,7 @@ require:
6
6
  # Default performance configurations: https://github.com/rubocop/rubocop-performance/blob/master/config/default.yml
7
7
  - rubocop-performance
8
8
  # Default rake configurations: https://github.com/rubocop/rubocop-rake/blob/master/config/default.yml
9
- <%= '- rubocop-rake' if RUBY_VERSION >= '2.4.0' %>
9
+ - rubocop-rake
10
10
 
11
11
  AllCops:
12
12
  TargetRubyVersion: 2.7
@@ -239,10 +239,6 @@ Layout/ClosingParenthesisIndentation:
239
239
  Layout/CommentIndentation:
240
240
  Enabled: true
241
241
 
242
- # Disabling for now
243
- Layout/ConditionPosition:
244
- Enabled: false
245
-
246
242
  Layout/DefEndAlignment:
247
243
  Enabled: true
248
244
  EnforcedStyleAlignWith: start_of_line
@@ -261,19 +257,9 @@ Layout/EmptyComment:
261
257
  AllowBorderComment: true
262
258
  AllowMarginComment: true
263
259
 
264
- # Disabling for now
265
- Layout/EmptyLineAfterMagicComment:
266
- Enabled: false
267
-
268
260
  Layout/EmptyLineAfterMultilineCondition:
269
261
  Enabled: false
270
262
 
271
- # Disabling for now
272
- Layout/EmptyLineBetweenDefs:
273
- Enabled: false
274
- # AllowAdjacentOneLineDefs: false
275
- # NumberOfEmptyLines: 1
276
-
277
263
  Layout/EmptyLines:
278
264
  Enabled: true
279
265
 
@@ -362,10 +348,6 @@ Layout/HashAlignment:
362
348
  Layout/HeredocArgumentClosingParenthesis:
363
349
  Enabled: false
364
350
 
365
- # Disabling for now
366
- Layout/HeredocIndentation:
367
- Enabled: false
368
-
369
351
  Layout/IndentationConsistency:
370
352
  Enabled: true
371
353
  EnforcedStyle: normal
@@ -505,11 +487,6 @@ Layout/SpaceBeforeFirstArg:
505
487
  Layout/SpaceBeforeSemicolon:
506
488
  Enabled: true
507
489
 
508
- # Disabling for now
509
- Layout/SpaceInLambdaLiteral:
510
- Enabled: false
511
- # EnforcedStyle: require_no_space
512
-
513
490
  Layout/SpaceInsideArrayLiteralBrackets:
514
491
  Enabled: true
515
492
  EnforcedStyle: no_space
@@ -533,10 +510,6 @@ Layout/SpaceInsideParens:
533
510
  Enabled: true
534
511
  EnforcedStyle: no_space
535
512
 
536
- # Disabling for now
537
- Layout/SpaceInsidePercentLiteralDelimiters:
538
- Enabled: false
539
-
540
513
  Layout/SpaceInsideRangeLiteral:
541
514
  Enabled: true
542
515
 
@@ -563,40 +536,24 @@ Lint/AmbiguousAssignment:
563
536
  Lint/AmbiguousBlockAssociation:
564
537
  Enabled: false
565
538
 
566
- # Disabling for now
567
- Lint/AmbiguousOperator:
568
- Enabled: false
569
-
570
539
  Lint/AmbiguousOperatorPrecedence:
571
540
  Enabled: false
572
541
 
573
542
  Lint/AmbiguousRange:
574
543
  Enabled: false
575
544
 
576
- # Disabling for now
577
- Lint/AmbiguousRegexpLiteral:
578
- Enabled: false
579
-
580
- # Disabling for now
581
545
  Lint/AssignmentInCondition:
582
546
  Enabled: false
583
- # AllowSafeAssignment: true
584
547
 
585
548
  Lint/BigDecimalNew:
586
549
  Enabled: true
587
550
 
588
- # Disabling for now
589
551
  Lint/BinaryOperatorWithIdenticalOperands:
590
552
  Enabled: false
591
553
 
592
- # Disabling for now
593
- Lint/BooleanSymbol:
594
- Enabled: false
595
-
596
554
  Lint/CircularArgumentReference:
597
555
  Enabled: true
598
556
 
599
- # Disabling for now
600
557
  Lint/ConstantDefinitionInBlock:
601
558
  Enabled: false
602
559
 
@@ -606,10 +563,6 @@ Lint/ConstantResolution:
606
563
  Lint/Debugger:
607
564
  Enabled: true
608
565
 
609
- # Disabling for now
610
- Lint/DeprecatedClassMethods:
611
- Enabled: false
612
-
613
566
  Lint/DeprecatedConstants:
614
567
  Enabled: true
615
568
 
@@ -622,20 +575,12 @@ Lint/DisjunctiveAssignmentInConstructor:
622
575
  Lint/DuplicateBranch:
623
576
  Enabled: false
624
577
 
625
- # Disabling for now
626
- Lint/DuplicateCaseCondition:
627
- Enabled: false
628
-
629
578
  Lint/DuplicateElsifCondition:
630
579
  Enabled: true
631
580
 
632
581
  Lint/DuplicateHashKey:
633
582
  Enabled: true
634
583
 
635
- # Disabling for now
636
- Lint/DuplicateMethods:
637
- Enabled: false
638
-
639
584
  Lint/DuplicateRegexpCharacterClassElement:
640
585
  Enabled: true
641
586
 
@@ -660,11 +605,6 @@ Lint/EmptyClass:
660
605
  Lint/EmptyConditionalBody:
661
606
  Enabled: false
662
607
 
663
- # Disabling for now
664
- Lint/EmptyEnsure:
665
- Enabled: false
666
- # AutoCorrect: true
667
-
668
608
  Lint/EmptyExpression:
669
609
  Enabled: true
670
610
 
@@ -681,10 +621,6 @@ Lint/EmptyWhen:
681
621
  Enabled: true
682
622
  AllowComments: true
683
623
 
684
- # Disabling for now
685
- Lint/EnsureReturn:
686
- Enabled: false
687
-
688
624
  Lint/ErbNewArguments:
689
625
  Enabled: true
690
626
 
data/.simplecov CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'securerandom'
3
4
 
4
5
  if ENV['CI']
data/Brewfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  brew 'elasticsearch'
3
4
  brew 'imagemagick'
4
5
  brew 'memcached'
data/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # New Relic Ruby Agent Release Notes
2
2
 
3
+ ## v9.2.1
4
+
5
+ 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.
6
+
7
+ - **Bugfix: Finished transactions continue to store data on different threads**
8
+
9
+ 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)
10
+
11
+
12
+ - **Bugfix: Expected Errors passed to notice_error are expected again**
13
+
14
+ 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)
15
+
16
+
17
+
18
+ ## v9.2.0
19
+
20
+ 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).
21
+
22
+ - **Feature: Enhance performance for handling high numbers of nested actions**
23
+
24
+ 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.
25
+ 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.
26
+ 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)
27
+
28
+ - **Feature: The agent configuration will now reflect whether module prepending or method chaining was used for instrumentation**
29
+
30
+ 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)
31
+
32
+ - **Feature: Deprecate memcached and memcache-client instrumentation**
33
+
34
+ Instrumentation for the memcached and memcache-client libraries is deprecated and will be removed during the next major release.
35
+
3
36
  ## v9.1.0
4
37
 
5
38
  Version 9.1.0 of the agent delivers support for two new [errors inbox](https://docs.newrelic.com/docs/errors-inbox/errors-inbox/) features: error fingerprinting and user tracking, identifies the Amazon Timestream data store, removes Distributed Tracing warnings from agent logs when using Sidekiq, fixes bugs, and is tested against the recently released JRuby 9.4.2.0.
data/Guardfile CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require './test/multiverse/lib/multiverse/bundler_patch'
3
4
 
4
5
  test_folders = Dir.glob('test/new_relic/*').select { |f| File.directory?(f) }
data/bin/newrelic CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
+
3
4
  # executes one of the commands in the new_relic/commands directory
4
5
  # pass the name of the command as an argument
5
6
 
data/bin/newrelic_cmd CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
+
3
4
  # This command has been renamed "newrelic"
4
5
  # executes one of the commands in the new_relic/commands directory
5
6
  # pass the name of the command as an argument