newrelic_rpm 9.2.2 → 9.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.build_ignore +21 -0
  3. data/CHANGELOG.md +55 -0
  4. data/README.md +4 -4
  5. data/lib/new_relic/agent/configuration/default_source.rb +77 -29
  6. data/lib/new_relic/agent/configuration/manager.rb +3 -2
  7. data/lib/new_relic/agent/configuration/yaml_source.rb +13 -0
  8. data/lib/new_relic/agent/instrumentation/active_record.rb +1 -1
  9. data/lib/new_relic/agent/instrumentation/active_record_notifications.rb +2 -1
  10. data/lib/new_relic/agent/instrumentation/concurrent_ruby/chain.rb +1 -1
  11. data/lib/new_relic/agent/instrumentation/concurrent_ruby/instrumentation.rb +1 -2
  12. data/lib/new_relic/agent/instrumentation/concurrent_ruby/prepend.rb +1 -1
  13. data/lib/new_relic/agent/instrumentation/fiber/chain.rb +10 -3
  14. data/lib/new_relic/agent/instrumentation/fiber/instrumentation.rb +1 -2
  15. data/lib/new_relic/agent/instrumentation/fiber/prepend.rb +10 -3
  16. data/lib/new_relic/agent/instrumentation/memcache/instrumentation.rb +3 -3
  17. data/lib/new_relic/agent/instrumentation/rails_notifications/action_cable.rb +1 -1
  18. data/lib/new_relic/agent/instrumentation/thread/chain.rb +1 -1
  19. data/lib/new_relic/agent/instrumentation/thread/instrumentation.rb +0 -1
  20. data/lib/new_relic/agent/instrumentation/thread/prepend.rb +1 -1
  21. data/lib/new_relic/agent/log_event_aggregator.rb +49 -2
  22. data/lib/new_relic/agent/log_event_attributes.rb +115 -0
  23. data/lib/new_relic/agent/logging.rb +4 -4
  24. data/lib/new_relic/agent/method_tracer_helpers.rb +26 -5
  25. data/lib/new_relic/agent/tracer.rb +2 -2
  26. data/lib/new_relic/agent.rb +37 -0
  27. data/lib/new_relic/dependency_detection.rb +6 -0
  28. data/lib/new_relic/latest_changes.rb +1 -1
  29. data/lib/new_relic/supportability_helper.rb +1 -0
  30. data/lib/new_relic/traced_thread.rb +2 -3
  31. data/lib/new_relic/version.rb +2 -2
  32. data/lib/sequel/extensions/new_relic_instrumentation.rb +1 -1
  33. data/lib/tasks/bump_version.rake +21 -0
  34. data/lib/tasks/helpers/newrelicyml.rb +144 -0
  35. data/lib/tasks/helpers/version_bump.rb +62 -0
  36. data/lib/tasks/multiverse.rb +0 -8
  37. data/lib/tasks/newrelicyml.rake +13 -0
  38. data/newrelic.yml +307 -266
  39. data/newrelic_rpm.gemspec +5 -4
  40. metadata +12 -22
  41. data/.gitignore +0 -43
  42. data/.project +0 -23
  43. data/.rubocop.yml +0 -1845
  44. data/.rubocop_todo.yml +0 -61
  45. data/.simplecov +0 -16
  46. data/.snyk +0 -11
  47. data/.yardopts +0 -27
  48. data/Brewfile +0 -13
  49. data/DOCKER.md +0 -167
  50. data/Dockerfile +0 -10
  51. data/Guardfile +0 -27
  52. data/config/database.yml +0 -5
  53. data/config.dot +0 -278
  54. data/docker-compose.yml +0 -107
  55. data/lefthook.yml +0 -9
  56. data/test/agent_helper.rb +0 -1027
@@ -0,0 +1,62 @@
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 VersionBump
6
+ MAJOR = 0
7
+ MINOR = 1
8
+ TINY = 2
9
+ VERSION = {major: MAJOR, minor: MINOR, tiny: TINY}
10
+
11
+ # Updates version.rb with new version number
12
+ def self.update_version
13
+ bump_type = determine_bump_type
14
+ file = read_file('lib/new_relic/version.rb')
15
+ new_version = {}
16
+
17
+ VERSION.each do |key, current|
18
+ file.gsub!(/(#{key.to_s.upcase} = )(\d+)/) do
19
+ match = Regexp.last_match
20
+
21
+ new_version[key] = if bump_type == current # bump type, increase by 1
22
+ match[2].to_i + 1
23
+ elsif bump_type < current # right of bump type, goes to 0
24
+ 0
25
+ else # left of bump type, stays the same
26
+ match[2].to_i
27
+ end
28
+
29
+ match[1] + new_version[key].to_s
30
+ end
31
+ end
32
+
33
+ write_file('lib/new_relic/version.rb', file)
34
+ new_version.values.join('.')
35
+ end
36
+
37
+ def self.read_file(path)
38
+ File.read(File.expand_path(path))
39
+ end
40
+
41
+ def self.write_file(path, file)
42
+ File.write(File.expand_path(path), file)
43
+ end
44
+
45
+ # Determined version based on if changelog has a feature or not for version
46
+ def self.determine_bump_type
47
+ file = read_file('CHANGELOG.md')
48
+ lines = file.split('## ')[1].split('- **')
49
+ return MAJOR if lines.first.include?('Major version')
50
+ return MINOR if lines.any? { |line| line.include?('Feature:') }
51
+
52
+ TINY
53
+ end
54
+
55
+ # Replace dev with version number in changelog
56
+ def self.update_changelog(version)
57
+ file = read_file('CHANGELOG.md')
58
+ file.gsub!(/## dev/, "## v#{version}")
59
+ file.gsub!(/Version <dev>/, "Version #{version}")
60
+ write_file('CHANGELOG.md', file)
61
+ end
62
+ end
@@ -65,14 +65,6 @@ namespace :test do
65
65
  File.delete(*Dir[glob])
66
66
  end
67
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
68
  task :prime, [:suite] => [:env] do |_, args|
77
69
  Multiverse::Runner.prime(args.suite, Multiverse::Runner.parse_args(args))
78
70
  end
@@ -0,0 +1,13 @@
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
+ require_relative './helpers/newrelicyml'
6
+
7
+ namespace :newrelic do
8
+ desc 'Update newrelic.yml with latest config options from default_source.rb'
9
+ task :update_newrelicyml do
10
+ NewRelicYML.write_file
11
+ puts 'newrelic.yml updated'
12
+ end
13
+ end