newrelic_rpm 9.2.0 → 9.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. checksums.yaml +4 -4
  2. data/.build_ignore +26 -0
  3. data/CHANGELOG.md +197 -2
  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 +218 -63
  7. data/lib/new_relic/agent/configuration/environment_source.rb +1 -1
  8. data/lib/new_relic/agent/configuration/manager.rb +14 -0
  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/error_collector.rb +1 -1
  12. data/lib/new_relic/agent/instrumentation/action_controller_other_subscriber.rb +1 -1
  13. data/lib/new_relic/agent/instrumentation/active_record.rb +1 -1
  14. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +2 -1
  15. data/lib/new_relic/agent/instrumentation/active_support_logger/instrumentation.rb +4 -0
  16. data/lib/new_relic/agent/instrumentation/bunny/instrumentation.rb +9 -0
  17. data/lib/new_relic/agent/instrumentation/concurrent_ruby/chain.rb +1 -1
  18. data/lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb +3 -4
  19. data/lib/new_relic/agent/instrumentation/concurrent_ruby/prepend.rb +1 -1
  20. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +1 -2
  21. data/lib/new_relic/agent/instrumentation/curb/instrumentation.rb +4 -0
  22. data/lib/new_relic/agent/instrumentation/delayed_job/instrumentation.rb +3 -0
  23. data/lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb +4 -1
  24. data/lib/new_relic/agent/instrumentation/excon/middleware.rb +3 -0
  25. data/lib/new_relic/agent/instrumentation/fiber/chain.rb +10 -3
  26. data/lib/new_relic/agent/instrumentation/fiber/instrumentation.rb +1 -2
  27. data/lib/new_relic/agent/instrumentation/fiber/prepend.rb +10 -3
  28. data/lib/new_relic/agent/instrumentation/grape/instrumentation.rb +4 -0
  29. data/lib/new_relic/agent/instrumentation/grpc/client/instrumentation.rb +4 -0
  30. data/lib/new_relic/agent/instrumentation/grpc/server/instrumentation.rb +4 -0
  31. data/lib/new_relic/agent/instrumentation/grpc_client.rb +1 -1
  32. data/lib/new_relic/agent/instrumentation/grpc_server.rb +1 -1
  33. data/lib/new_relic/agent/instrumentation/httpclient/instrumentation.rb +4 -0
  34. data/lib/new_relic/agent/instrumentation/httprb/instrumentation.rb +4 -0
  35. data/lib/new_relic/agent/instrumentation/logger/instrumentation.rb +3 -0
  36. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +12 -3
  37. data/lib/new_relic/agent/instrumentation/memcache.rb +2 -2
  38. data/lib/new_relic/agent/instrumentation/net_http/instrumentation.rb +4 -0
  39. data/lib/new_relic/agent/instrumentation/notifications_subscriber.rb +4 -0
  40. data/lib/new_relic/agent/instrumentation/padrino/instrumentation.rb +4 -0
  41. data/lib/new_relic/agent/instrumentation/queue_time.rb +1 -1
  42. data/lib/new_relic/agent/instrumentation/rack/instrumentation.rb +6 -0
  43. data/lib/new_relic/agent/instrumentation/rails3/action_controller.rb +4 -0
  44. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +1 -1
  45. data/lib/new_relic/agent/instrumentation/rake/instrumentation.rb +4 -0
  46. data/lib/new_relic/agent/instrumentation/redis/instrumentation.rb +4 -0
  47. data/lib/new_relic/agent/instrumentation/resque/instrumentation.rb +4 -0
  48. data/lib/new_relic/agent/instrumentation/roda/chain.rb +43 -0
  49. data/lib/new_relic/agent/instrumentation/roda/instrumentation.rb +56 -0
  50. data/lib/new_relic/agent/instrumentation/roda/prepend.rb +24 -0
  51. data/lib/new_relic/agent/instrumentation/roda/roda_transaction_namer.rb +30 -0
  52. data/lib/new_relic/agent/instrumentation/roda.rb +34 -0
  53. data/lib/new_relic/agent/instrumentation/sequel.rb +1 -1
  54. data/lib/new_relic/agent/instrumentation/sidekiq/client.rb +4 -0
  55. data/lib/new_relic/agent/instrumentation/sidekiq/server.rb +26 -3
  56. data/lib/new_relic/agent/instrumentation/sidekiq.rb +2 -2
  57. data/lib/new_relic/agent/instrumentation/sinatra/instrumentation.rb +4 -0
  58. data/lib/new_relic/agent/instrumentation/stripe.rb +28 -0
  59. data/lib/new_relic/agent/instrumentation/stripe_subscriber.rb +77 -0
  60. data/lib/new_relic/agent/instrumentation/thread/chain.rb +1 -1
  61. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +0 -1
  62. data/lib/new_relic/agent/instrumentation/thread/prepend.rb +1 -1
  63. data/lib/new_relic/agent/instrumentation/tilt/instrumentation.rb +4 -0
  64. data/lib/new_relic/agent/instrumentation/typhoeus/instrumentation.rb +5 -1
  65. data/lib/new_relic/agent/log_event_aggregator.rb +49 -2
  66. data/lib/new_relic/agent/log_event_attributes.rb +115 -0
  67. data/lib/new_relic/agent/logging.rb +4 -4
  68. data/lib/new_relic/agent/method_tracer_helpers.rb +26 -5
  69. data/lib/new_relic/agent/new_relic_service.rb +33 -17
  70. data/lib/new_relic/agent/pipe_service.rb +1 -1
  71. data/lib/new_relic/agent/tracer.rb +7 -6
  72. data/lib/new_relic/agent/transaction/abstract_segment.rb +52 -0
  73. data/lib/new_relic/agent/transaction/request_attributes.rb +45 -7
  74. data/lib/new_relic/agent/transaction/tracing.rb +6 -0
  75. data/lib/new_relic/agent/transaction.rb +9 -4
  76. data/lib/new_relic/agent/utilization/vendor.rb +5 -7
  77. data/lib/new_relic/agent.rb +50 -1
  78. data/lib/new_relic/cli/command.rb +1 -0
  79. data/lib/new_relic/control/class_methods.rb +1 -7
  80. data/lib/new_relic/control/frameworks/roda.rb +20 -0
  81. data/lib/new_relic/control/instrumentation.rb +0 -14
  82. data/lib/new_relic/dependency_detection.rb +16 -1
  83. data/lib/new_relic/language_support.rb +5 -0
  84. data/lib/new_relic/latest_changes.rb +1 -1
  85. data/lib/new_relic/noticed_error.rb +5 -2
  86. data/lib/new_relic/rack/agent_hooks.rb +1 -1
  87. data/lib/new_relic/rack/agent_middleware.rb +0 -16
  88. data/lib/new_relic/rack/browser_monitoring.rb +1 -1
  89. data/lib/new_relic/supportability_helper.rb +2 -0
  90. data/lib/new_relic/traced_thread.rb +2 -3
  91. data/lib/new_relic/version.rb +1 -1
  92. data/lib/sequel/extensions/new_relic_instrumentation.rb +1 -1
  93. data/lib/tasks/bump_version.rake +21 -0
  94. data/lib/tasks/config.rake +3 -2
  95. data/lib/tasks/helpers/config.html.erb +93 -0
  96. data/lib/tasks/helpers/format.rb +11 -7
  97. data/lib/tasks/helpers/newrelicyml.rb +144 -0
  98. data/lib/tasks/helpers/version_bump.rb +62 -0
  99. data/lib/tasks/newrelicyml.rake +13 -0
  100. data/newrelic.yml +364 -267
  101. data/newrelic_rpm.gemspec +11 -7
  102. metadata +36 -25
  103. data/.gitignore +0 -43
  104. data/.project +0 -23
  105. data/.rubocop.yml +0 -1845
  106. data/.rubocop_todo.yml +0 -61
  107. data/.simplecov +0 -16
  108. data/.snyk +0 -11
  109. data/.yardopts +0 -27
  110. data/Brewfile +0 -13
  111. data/DOCKER.md +0 -167
  112. data/Dockerfile +0 -10
  113. data/Guardfile +0 -27
  114. data/config/database.yml +0 -5
  115. data/config.dot +0 -278
  116. data/docker-compose.yml +0 -107
  117. data/lefthook.yml +0 -9
  118. data/lib/tasks/helpers/removers.rb +0 -33
  119. data/lib/tasks/multiverse.rake +0 -6
  120. data/lib/tasks/multiverse.rb +0 -84
data/docker-compose.yml DELETED
@@ -1,107 +0,0 @@
1
- version: "3.9"
2
- services:
3
- elasticsearch7:
4
- image: elasticsearch:7.16.2
5
- ports:
6
- - "9200:9200"
7
- environment:
8
- - discovery.type=single-node
9
- - bootstrap.memory_lock=true
10
- - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
11
- mem_limit: 1g
12
- elasticsearch8:
13
- image: elasticsearch:8.4.2
14
- ports:
15
- - "9250:9250"
16
- environment:
17
- - discovery.type=single-node
18
- - xpack.security.enabled=false
19
- - http.port=9250
20
- - bootstrap.memory_lock=true
21
- - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
22
- mem_limit: 1g
23
- mysql:
24
- image: mysql:5.7
25
- restart: always
26
- environment:
27
- MYSQL_ROOT_PASSWORD: mysql_root_password
28
- MYSQL_DATABASE: app
29
- expose:
30
- - "3306"
31
- volumes:
32
- - mysql:/var/lib/mysql
33
- rabbitmq:
34
- image: rabbitmq:3.9.12
35
- restart: always
36
- environment:
37
- RABBITMQ_NODENAME: rabbit
38
- expose:
39
- - "5672"
40
- - "15672"
41
- - "25672"
42
- - "4369"
43
- memcached:
44
- image: memcached:1.6.12
45
- restart: always
46
- expose:
47
- - "11211"
48
- mongodb:
49
- image: mongo:5.0.4
50
- restart: always
51
- volumes:
52
- - /data/db
53
- expose:
54
- - "27017"
55
- postgres:
56
- image: postgres:14.2
57
- restart: always
58
- environment:
59
- POSTGRES_USER: admin
60
- POSTGRES_PASSWORD: postgres_password
61
- volumes:
62
- - postgres:/var/lib/postgresql/data
63
- expose:
64
- - "5432"
65
- redis:
66
- image: redis:6.2.6
67
- restart: always
68
- volumes:
69
- - /var/lib/redis
70
- expose:
71
- - "6379"
72
- app:
73
- build:
74
- context: .
75
- args:
76
- - ruby_version=${RUBY_VERSION:-3.1}
77
- image: newrelic_rpm
78
- tty: true
79
- stdin_open: true
80
- environment:
81
- MYSQL_USERNAME: root
82
- MYSQL_PASSWORD: mysql_root_password
83
- DATABASE_NAME: app
84
- MYSQL_HOST: mysql
85
- POSTGRES_USERNAME: admin
86
- POSTGRES_PASSWORD: postgres_password
87
- command: ["irb"]
88
- volumes:
89
- - ".:/usr/src/app"
90
- depends_on:
91
- - elasticsearch7
92
- - elasticsearch8
93
- - mysql
94
- - memcached
95
- - mongodb
96
- - postgres
97
- - rabbitmq
98
- - redis
99
- sysctls:
100
- - "net.ipv6.conf.all.disable_ipv6=0"
101
- volumes:
102
- mongodb:
103
- driver: local
104
- mysql:
105
- driver: local
106
- postgres:
107
- driver: local
data/lefthook.yml DELETED
@@ -1,9 +0,0 @@
1
- # Lefthook (https://github.com/evilmartians/lefthook) is a git hooks manager
2
- # Install it on your machine by running `gem install lefthook`
3
- pre-commit:
4
- parallel: true
5
- commands:
6
- rubocop:
7
- files: git diff --name-only --staged
8
- glob: "*.rb"
9
- run: rubocop --force-exclusion {files}
@@ -1,33 +0,0 @@
1
- # This file is distributed under New Relic's license terms.
2
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
- # frozen_string_literal: true
4
-
5
- module Removers
6
- def remove_local_multiverse_databases
7
- list_databases_command = %(echo "show databases" | mysql -u root)
8
- databases = `#{list_databases_command}`.chomp!.split("\n").select { |s| s.include?('multiverse') }
9
- databases.each do |database|
10
- puts "Dropping #{database}"
11
- `echo "drop database #{database}" | mysql -u root`
12
- end
13
- rescue => error
14
- puts 'ERROR: Cannot get MySQL databases...'
15
- puts error.message
16
- end
17
-
18
- def remove_generated_gemfiles
19
- file_path = File.expand_path('test/multiverse/suites')
20
- Dir.glob(File.join(file_path, '**', 'Gemfile*')).each do |fn|
21
- puts "Removing #{fn.gsub(file_path, '.../suites')}"
22
- FileUtils.rm(fn)
23
- end
24
- end
25
-
26
- def remove_generated_gemfile_lockfiles
27
- file_path = File.expand_path('test/environments')
28
- Dir.glob(File.join(file_path, '**', 'Gemfile.lock')).each do |fn|
29
- puts "Removing #{fn.gsub(file_path, '.../environments')}"
30
- FileUtils.rm(fn)
31
- end
32
- end
33
- end
@@ -1,6 +0,0 @@
1
- # This file is distributed under New Relic's license terms.
2
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
- # frozen_string_literal: true
4
-
5
- # Guts of task are in a .rb file to allow requiring from external gems
6
- require "#{File.join(File.dirname(__FILE__))}/multiverse"
@@ -1,84 +0,0 @@
1
- # This file is distributed under New Relic's license terms.
2
- # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
3
- # frozen_string_literal: true
4
-
5
- #
6
- # Rake task for running Ruby agent multiverse tests. This file may be required
7
- # from third party gems. It is also used by the agent itself to run multiverse.
8
- #
9
- # Multiverse tests are grouped in (potentially multiverse) "suite" directories.
10
- # These suites are found by default under ./test/multiverse. That location can
11
- # be overridden with ENV['SUITES_DIRECTORY'].
12
- #
13
- # The first parameter to this task is a suite directory name to run. If
14
- # excluded, multiverse will run all suites it finds.
15
- #
16
- # Additional parameters are allowed to multiverse. Many parameters can be
17
- # combined.
18
- #
19
- # Some examples:
20
- #
21
- # # Runs ./test/multiverse/*
22
- # bundle exec rake test:multiverse
23
- #
24
- # # Runs ./test/multiverse/my_gem
25
- # bundle exec rake test:multiverse[my_gem]
26
- #
27
- # # With verbose logging and debugging via pry
28
- # bundle exec rake test:multiverse[my_gem,verbose,debug]
29
- #
30
- # # Runs only first set of gems defined in my_gem's Envfile
31
- # bundle exec rake test:multiverse[my_gem,env=0]
32
- #
33
- # # Runs tests matching the passed name (via Minitest's built-in filtering)
34
- # bundle exec rake test:multiverse[my_gem,name=MyGemTest]
35
- #
36
- # # Runs with a specific test seed
37
- # bundle exec rake test:multiverse[my_gem,seed=1337]
38
-
39
- require_relative 'helpers/removers'
40
- include Removers
41
-
42
- namespace :test do
43
- desc 'Run functional test suite for New Relic'
44
- task :multiverse, [:suite, :param1, :param2, :param3, :param4] => ['multiverse:env'] do |_, args|
45
- Multiverse::Runner.run(args.suite, Multiverse::Runner.parse_args(args))
46
- end
47
-
48
- namespace :multiverse do
49
- # task :prerequisites
50
-
51
- task :env do
52
- # ENV['SUITES_DIRECTORY'] = File.expand_path('../../test/multiverse/suites', __FILE__)
53
- require File.expand_path('../../../test/multiverse/lib/multiverse', __FILE__)
54
- end
55
-
56
- task :clobber do
57
- remove_local_multiverse_databases
58
- remove_generated_gemfiles
59
- remove_generated_gemfile_lockfiles
60
- end
61
-
62
- desc 'Clean cached gemfiles from Bundler.bundle_path'
63
- task :clean_gemfile_cache do
64
- glob = File.expand_path('multiverse-cache/Gemfile.*.lock', Bundler.bundle_path)
65
- File.delete(*Dir[glob])
66
- end
67
-
68
- desc 'Test the multiverse testing framework by executing tests in test/multiverse/test. Get meta with it.'
69
- task :self, [:suite, :mode] do |_, args|
70
- args.with_defaults(:suite => '', :mode => '')
71
- puts ('Testing the multiverse testing framework...')
72
- test_files = FileList['test/multiverse/test/*_test.rb']
73
- ruby test_files.join(' ')
74
- end
75
-
76
- task :prime, [:suite] => [:env] do |_, args|
77
- Multiverse::Runner.prime(args.suite, Multiverse::Runner.parse_args(args))
78
- end
79
-
80
- task :gem_manifest => :env do
81
- Multiverse::GemManifest.new.report
82
- end
83
- end
84
- end