newrelic_rpm 9.5.0 → 9.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +112 -7
  3. data/CONTRIBUTING.md +0 -7
  4. data/Rakefile +1 -1
  5. data/bin/newrelic +2 -9
  6. data/bin/newrelic_rpm +15 -0
  7. data/init.rb +2 -2
  8. data/lib/new_relic/agent/agent.rb +1 -1
  9. data/lib/new_relic/agent/agent_helpers/shutdown.rb +1 -1
  10. data/lib/new_relic/agent/agent_helpers/special_startup.rb +1 -1
  11. data/lib/new_relic/agent/agent_helpers/start_worker_thread.rb +2 -2
  12. data/lib/new_relic/agent/agent_helpers/startup.rb +2 -2
  13. data/lib/new_relic/agent/attribute_filter.rb +3 -3
  14. data/lib/new_relic/agent/configuration/default_source.rb +94 -35
  15. data/lib/new_relic/agent/configuration/manager.rb +8 -7
  16. data/lib/new_relic/agent/datastores/mongo/metric_translator.rb +1 -1
  17. data/lib/new_relic/agent/distributed_tracing/distributed_trace_payload.rb +3 -3
  18. data/lib/new_relic/agent/event_loop.rb +1 -1
  19. data/lib/new_relic/agent/http_clients/abstract.rb +4 -0
  20. data/lib/new_relic/agent/http_clients/async_http_wrappers.rb +80 -0
  21. data/lib/new_relic/agent/http_clients/curb_wrappers.rb +1 -3
  22. data/lib/new_relic/agent/http_clients/ethon_wrappers.rb +109 -0
  23. data/lib/new_relic/agent/http_clients/excon_wrappers.rb +0 -3
  24. data/lib/new_relic/agent/http_clients/http_rb_wrappers.rb +1 -3
  25. data/lib/new_relic/agent/http_clients/httpclient_wrappers.rb +0 -3
  26. data/lib/new_relic/agent/http_clients/httpx_wrappers.rb +91 -0
  27. data/lib/new_relic/agent/http_clients/net_http_wrappers.rb +1 -4
  28. data/lib/new_relic/agent/http_clients/typhoeus_wrappers.rb +0 -3
  29. data/lib/new_relic/agent/instrumentation/active_merchant.rb +1 -1
  30. data/lib/new_relic/agent/instrumentation/active_record_helper.rb +1 -2
  31. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/chain.rb +69 -0
  32. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/instrumentation.rb +13 -0
  33. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger/prepend.rb +37 -0
  34. data/lib/new_relic/agent/instrumentation/active_support_broadcast_logger.rb +23 -0
  35. data/lib/new_relic/agent/instrumentation/active_support_logger.rb +3 -1
  36. data/lib/new_relic/agent/instrumentation/async_http/chain.rb +23 -0
  37. data/lib/new_relic/agent/instrumentation/async_http/instrumentation.rb +37 -0
  38. data/lib/new_relic/agent/instrumentation/async_http/prepend.rb +15 -0
  39. data/lib/new_relic/agent/instrumentation/async_http.rb +26 -0
  40. data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +1 -1
  41. data/lib/new_relic/agent/instrumentation/ethon/chain.rb +39 -0
  42. data/lib/new_relic/agent/instrumentation/ethon/instrumentation.rb +105 -0
  43. data/lib/new_relic/agent/instrumentation/ethon/prepend.rb +35 -0
  44. data/lib/new_relic/agent/instrumentation/ethon.rb +39 -0
  45. data/lib/new_relic/agent/instrumentation/fiber/instrumentation.rb +1 -4
  46. data/lib/new_relic/agent/instrumentation/httpx/chain.rb +20 -0
  47. data/lib/new_relic/agent/instrumentation/httpx/instrumentation.rb +51 -0
  48. data/lib/new_relic/agent/instrumentation/httpx/prepend.rb +15 -0
  49. data/lib/new_relic/agent/instrumentation/httpx.rb +27 -0
  50. data/lib/new_relic/agent/instrumentation/mongodb_command_subscriber.rb +1 -3
  51. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +1 -1
  52. data/lib/new_relic/agent/instrumentation/rails_notifications/action_controller.rb +1 -0
  53. data/lib/new_relic/agent/instrumentation/roda/ignorer.rb +45 -0
  54. data/lib/new_relic/agent/instrumentation/roda/instrumentation.rb +12 -0
  55. data/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb +1 -2
  56. data/lib/new_relic/agent/instrumentation/roda.rb +2 -0
  57. data/lib/new_relic/agent/instrumentation/sidekiq.rb +3 -1
  58. data/lib/new_relic/agent/instrumentation/sinatra/ignorer.rb +1 -1
  59. data/lib/new_relic/agent/instrumentation/sinatra/transaction_namer.rb +1 -3
  60. data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -1
  61. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +1 -4
  62. data/lib/new_relic/agent/instrumentation/view_component/chain.rb +21 -0
  63. data/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb +38 -0
  64. data/lib/new_relic/agent/instrumentation/view_component/prepend.rb +13 -0
  65. data/lib/new_relic/agent/instrumentation/view_component.rb +26 -0
  66. data/lib/new_relic/agent/javascript_instrumentor.rb +0 -1
  67. data/lib/new_relic/agent/messaging.rb +2 -2
  68. data/lib/new_relic/agent/monitors/synthetics_monitor.rb +12 -1
  69. data/lib/new_relic/agent/new_relic_service/encoders.rb +2 -2
  70. data/lib/new_relic/agent/new_relic_service.rb +8 -6
  71. data/lib/new_relic/agent/obfuscator.rb +0 -2
  72. data/lib/new_relic/agent/pipe_channel_manager.rb +2 -2
  73. data/lib/new_relic/agent/rules_engine/segment_terms_rule.rb +1 -2
  74. data/lib/new_relic/agent/rules_engine.rb +1 -1
  75. data/lib/new_relic/agent/span_event_primitive.rb +16 -4
  76. data/lib/new_relic/agent/sql_sampler.rb +0 -1
  77. data/lib/new_relic/agent/system_info.rb +26 -0
  78. data/lib/new_relic/agent/tracer.rb +5 -6
  79. data/lib/new_relic/agent/transaction/abstract_segment.rb +3 -0
  80. data/lib/new_relic/agent/transaction/external_request_segment.rb +5 -2
  81. data/lib/new_relic/agent/transaction/message_broker_segment.rb +1 -2
  82. data/lib/new_relic/agent/transaction/request_attributes.rb +1 -3
  83. data/lib/new_relic/agent/transaction/tracing.rb +11 -1
  84. data/lib/new_relic/agent/transaction.rb +25 -2
  85. data/lib/new_relic/agent/transaction_error_primitive.rb +16 -0
  86. data/lib/new_relic/agent/transaction_event_primitive.rb +19 -0
  87. data/lib/new_relic/agent/utilization/gcp.rb +1 -3
  88. data/lib/new_relic/agent/vm/{mri_vm.rb → c_ruby_vm.rb} +7 -15
  89. data/lib/new_relic/agent/vm.rb +2 -2
  90. data/lib/new_relic/agent/worker_loop.rb +1 -1
  91. data/lib/new_relic/agent.rb +11 -7
  92. data/lib/new_relic/base64.rb +25 -0
  93. data/lib/new_relic/cli/command.rb +6 -4
  94. data/lib/new_relic/constants.rb +5 -0
  95. data/lib/new_relic/control/frameworks/rails.rb +17 -5
  96. data/lib/new_relic/control/instrumentation.rb +1 -1
  97. data/lib/new_relic/language_support.rb +4 -0
  98. data/lib/new_relic/local_environment.rb +22 -13
  99. data/lib/new_relic/supportability_helper.rb +1 -1
  100. data/lib/new_relic/version.rb +1 -1
  101. data/lib/tasks/config.rake +1 -1
  102. data/lib/tasks/helpers/config.html.erb +6 -6
  103. data/lib/tasks/helpers/newrelicyml.rb +1 -1
  104. data/lib/tasks/instrumentation_generator/instrumentation.thor +3 -3
  105. data/lib/tasks/tests.rake +71 -0
  106. data/newrelic.yml +55 -35
  107. data/newrelic_rpm.gemspec +5 -4
  108. data/test/agent_helper.rb +14 -2
  109. metadata +32 -7
  110. data/bin/newrelic_cmd +0 -7
data/newrelic_rpm.gemspec CHANGED
@@ -21,8 +21,8 @@ Gem::Specification.new do |s|
21
21
  https://github.com/newrelic/newrelic-ruby-agent/
22
22
  EOS
23
23
  s.email = 'support@newrelic.com'
24
- # TODO: MAJOR VERSION - remove newrelic_cmd, deprecated since version 2.13
25
- s.executables = %w[newrelic_cmd newrelic nrdebug]
24
+ # TODO: MAJOR VERSION - remove newrelic, deprecated since version xxx.
25
+ s.executables = %w[newrelic_rpm newrelic nrdebug]
26
26
  s.extra_rdoc_files = [
27
27
  'CHANGELOG.md',
28
28
  'LICENSE',
@@ -49,17 +49,18 @@ Gem::Specification.new do |s|
49
49
  s.homepage = 'https://github.com/newrelic/newrelic-ruby-agent'
50
50
  s.require_paths = ['lib']
51
51
  s.summary = 'New Relic Ruby Agent'
52
+
52
53
  s.add_development_dependency 'bundler'
53
54
  s.add_development_dependency 'feedjira', '3.2.1' unless ENV['CI'] || RUBY_VERSION < '2.5' # for Gabby
54
55
  s.add_development_dependency 'httparty' unless ENV['CI'] # for perf tests and Gabby
55
56
  s.add_development_dependency 'minitest', "#{RUBY_VERSION >= '2.7.0' ? '5.3.3' : '4.7.5'}"
56
57
  s.add_development_dependency 'minitest-stub-const', '0.6'
57
58
  s.add_development_dependency 'mocha', '~> 1.16'
58
- s.add_development_dependency 'pry' unless ENV['CI']
59
+ s.add_development_dependency 'pry' if ENV['ENABLE_PRY']
59
60
  s.add_development_dependency 'rack'
60
61
  s.add_development_dependency 'rake', '12.3.3'
61
62
 
62
- s.add_development_dependency 'rubocop', '1.54' unless ENV['CI'] && RUBY_VERSION < '3.0.0'
63
+ s.add_development_dependency 'rubocop', '1.57.2' unless ENV['CI'] && RUBY_VERSION < '3.0.0'
63
64
  s.add_development_dependency 'rubocop-ast', '1.28.1' unless ENV['CI'] && RUBY_VERSION < '3.0.0'
64
65
  s.add_development_dependency 'rubocop-minitest', '0.27.0' unless ENV['CI'] && RUBY_VERSION < '3.0.0'
65
66
  s.add_development_dependency 'rubocop-performance', '1.16.0' unless ENV['CI'] && RUBY_VERSION < '3.0.0'
data/test/agent_helper.rb CHANGED
@@ -845,7 +845,7 @@ ensure
845
845
  end
846
846
 
847
847
  def json_dump_and_encode(object)
848
- Base64.encode64(JSON.dump(object))
848
+ NewRelic::Base64.encode64(JSON.dump(object))
849
849
  end
850
850
 
851
851
  def get_last_analytics_event
@@ -871,7 +871,7 @@ def load_cross_agent_test(name)
871
871
  test_file_path = File.join(cross_agent_tests_dir, "#{name}.json")
872
872
  data = File.read(test_file_path)
873
873
  data.gsub!('callCount', 'call_count')
874
- data = JSON.load(data)
874
+ data = JSON.parse(data)
875
875
  data.each { |testcase| testcase['testname'].tr!(' ', '_') if String === testcase['testname'] }
876
876
  data
877
877
  end
@@ -1025,3 +1025,15 @@ def defer_testing_to_min_supported_rails(test_file, min_rails_version, supports_
1025
1025
  puts "Skipping tests in #{File.basename(test_file)} because Rails >= #{min_rails_version} is unavailable" if ENV['VERBOSE_TEST_OUTPUT']
1026
1026
  end
1027
1027
  end
1028
+
1029
+ def first_call_for(subject)
1030
+ items = $collector.calls_for(subject)
1031
+
1032
+ if defined?(JRUBY_VERSION)
1033
+ refute_predicate items.size, :zero?, "Expected at least one call for '#{subject}'"
1034
+ else
1035
+ assert_equal 1, items.size, "Expected exactly one call for '#{subject}'"
1036
+ end
1037
+
1038
+ items.first
1039
+ end
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.5.0
4
+ version: 9.7.0
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-09-12 00:00:00.000000000 Z
14
+ date: 2024-01-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -103,14 +103,14 @@ dependencies:
103
103
  requirements:
104
104
  - - '='
105
105
  - !ruby/object:Gem::Version
106
- version: '1.54'
106
+ version: 1.57.2
107
107
  type: :development
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - '='
112
112
  - !ruby/object:Gem::Version
113
- version: '1.54'
113
+ version: 1.57.2
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: rubocop-ast
116
116
  requirement: !ruby/object:Gem::Requirement
@@ -218,7 +218,7 @@ description: |
218
218
  https://github.com/newrelic/newrelic-ruby-agent/
219
219
  email: support@newrelic.com
220
220
  executables:
221
- - newrelic_cmd
221
+ - newrelic_rpm
222
222
  - newrelic
223
223
  - nrdebug
224
224
  extensions: []
@@ -239,7 +239,7 @@ files:
239
239
  - THIRD_PARTY_NOTICES.md
240
240
  - Thorfile
241
241
  - bin/newrelic
242
- - bin/newrelic_cmd
242
+ - bin/newrelic_rpm
243
243
  - bin/nrdebug
244
244
  - init.rb
245
245
  - install.rb
@@ -317,10 +317,13 @@ files:
317
317
  - lib/new_relic/agent/heap.rb
318
318
  - lib/new_relic/agent/hostname.rb
319
319
  - lib/new_relic/agent/http_clients/abstract.rb
320
+ - lib/new_relic/agent/http_clients/async_http_wrappers.rb
320
321
  - lib/new_relic/agent/http_clients/curb_wrappers.rb
322
+ - lib/new_relic/agent/http_clients/ethon_wrappers.rb
321
323
  - lib/new_relic/agent/http_clients/excon_wrappers.rb
322
324
  - lib/new_relic/agent/http_clients/http_rb_wrappers.rb
323
325
  - lib/new_relic/agent/http_clients/httpclient_wrappers.rb
326
+ - lib/new_relic/agent/http_clients/httpx_wrappers.rb
324
327
  - lib/new_relic/agent/http_clients/net_http_wrappers.rb
325
328
  - lib/new_relic/agent/http_clients/typhoeus_wrappers.rb
326
329
  - lib/new_relic/agent/http_clients/uri_util.rb
@@ -346,11 +349,19 @@ files:
346
349
  - lib/new_relic/agent/instrumentation/active_storage.rb
347
350
  - lib/new_relic/agent/instrumentation/active_storage_subscriber.rb
348
351
  - lib/new_relic/agent/instrumentation/active_support.rb
352
+ - lib/new_relic/agent/instrumentation/active_support_broadcast_logger.rb
353
+ - lib/new_relic/agent/instrumentation/active_support_broadcast_logger/chain.rb
354
+ - lib/new_relic/agent/instrumentation/active_support_broadcast_logger/instrumentation.rb
355
+ - lib/new_relic/agent/instrumentation/active_support_broadcast_logger/prepend.rb
349
356
  - lib/new_relic/agent/instrumentation/active_support_logger.rb
350
357
  - lib/new_relic/agent/instrumentation/active_support_logger/chain.rb
351
358
  - lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb
352
359
  - lib/new_relic/agent/instrumentation/active_support_logger/prepend.rb
353
360
  - lib/new_relic/agent/instrumentation/active_support_subscriber.rb
361
+ - lib/new_relic/agent/instrumentation/async_http.rb
362
+ - lib/new_relic/agent/instrumentation/async_http/chain.rb
363
+ - lib/new_relic/agent/instrumentation/async_http/instrumentation.rb
364
+ - lib/new_relic/agent/instrumentation/async_http/prepend.rb
354
365
  - lib/new_relic/agent/instrumentation/bunny.rb
355
366
  - lib/new_relic/agent/instrumentation/bunny/chain.rb
356
367
  - lib/new_relic/agent/instrumentation/bunny/instrumentation.rb
@@ -374,6 +385,10 @@ files:
374
385
  - lib/new_relic/agent/instrumentation/elasticsearch/chain.rb
375
386
  - lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb
376
387
  - lib/new_relic/agent/instrumentation/elasticsearch/prepend.rb
388
+ - lib/new_relic/agent/instrumentation/ethon.rb
389
+ - lib/new_relic/agent/instrumentation/ethon/chain.rb
390
+ - lib/new_relic/agent/instrumentation/ethon/instrumentation.rb
391
+ - lib/new_relic/agent/instrumentation/ethon/prepend.rb
377
392
  - lib/new_relic/agent/instrumentation/excon.rb
378
393
  - lib/new_relic/agent/instrumentation/excon/middleware.rb
379
394
  - lib/new_relic/agent/instrumentation/fiber.rb
@@ -403,6 +418,10 @@ files:
403
418
  - lib/new_relic/agent/instrumentation/httprb/chain.rb
404
419
  - lib/new_relic/agent/instrumentation/httprb/instrumentation.rb
405
420
  - lib/new_relic/agent/instrumentation/httprb/prepend.rb
421
+ - lib/new_relic/agent/instrumentation/httpx.rb
422
+ - lib/new_relic/agent/instrumentation/httpx/chain.rb
423
+ - lib/new_relic/agent/instrumentation/httpx/instrumentation.rb
424
+ - lib/new_relic/agent/instrumentation/httpx/prepend.rb
406
425
  - lib/new_relic/agent/instrumentation/ignore_actions.rb
407
426
  - lib/new_relic/agent/instrumentation/logger.rb
408
427
  - lib/new_relic/agent/instrumentation/logger/chain.rb
@@ -457,6 +476,7 @@ files:
457
476
  - lib/new_relic/agent/instrumentation/resque/prepend.rb
458
477
  - lib/new_relic/agent/instrumentation/roda.rb
459
478
  - lib/new_relic/agent/instrumentation/roda/chain.rb
479
+ - lib/new_relic/agent/instrumentation/roda/ignorer.rb
460
480
  - lib/new_relic/agent/instrumentation/roda/instrumentation.rb
461
481
  - lib/new_relic/agent/instrumentation/roda/prepend.rb
462
482
  - lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb
@@ -486,6 +506,10 @@ files:
486
506
  - lib/new_relic/agent/instrumentation/typhoeus/chain.rb
487
507
  - lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb
488
508
  - lib/new_relic/agent/instrumentation/typhoeus/prepend.rb
509
+ - lib/new_relic/agent/instrumentation/view_component.rb
510
+ - lib/new_relic/agent/instrumentation/view_component/chain.rb
511
+ - lib/new_relic/agent/instrumentation/view_component/instrumentation.rb
512
+ - lib/new_relic/agent/instrumentation/view_component/prepend.rb
489
513
  - lib/new_relic/agent/internal_agent_error.rb
490
514
  - lib/new_relic/agent/javascript_instrumentor.rb
491
515
  - lib/new_relic/agent/linking_metadata.rb
@@ -574,11 +598,12 @@ files:
574
598
  - lib/new_relic/agent/utilization/vendor.rb
575
599
  - lib/new_relic/agent/utilization_data.rb
576
600
  - lib/new_relic/agent/vm.rb
601
+ - lib/new_relic/agent/vm/c_ruby_vm.rb
577
602
  - lib/new_relic/agent/vm/jruby_vm.rb
578
603
  - lib/new_relic/agent/vm/monotonic_gc_profiler.rb
579
- - lib/new_relic/agent/vm/mri_vm.rb
580
604
  - lib/new_relic/agent/vm/snapshot.rb
581
605
  - lib/new_relic/agent/worker_loop.rb
606
+ - lib/new_relic/base64.rb
582
607
  - lib/new_relic/cli/command.rb
583
608
  - lib/new_relic/cli/commands/deployments.rb
584
609
  - lib/new_relic/cli/commands/install.rb
data/bin/newrelic_cmd DELETED
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- # This command has been renamed "newrelic"
5
- # executes one of the commands in the new_relic/commands directory
6
- # pass the name of the command as an argument
7
- load File.dirname(__FILE__) + '/newrelic'