scout_apm 5.3.3 → 5.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1e83c44e949efe75ec1ee2c429b0596816c2b9f8e7c5416e7f3dd7243ef69c4
4
- data.tar.gz: 9b8a870504f4b32729ddb85f999cf7af30f6aac4215d356caefda6db2349dfb8
3
+ metadata.gz: 656e36a7b9a11b5870058c46b31e8227c628691f8ab7f7d4de991c3e89b5f13d
4
+ data.tar.gz: 5f27c0af5b3f864a96ea65944c6655106a86aa96dbf489083b1c3a178322d827
5
5
  SHA512:
6
- metadata.gz: ac045625ade6b059933ce82b1eaa014be50ce2eea7db34fb1e8a1f94145810c814bb95ba4cb8b70858547a3aaddebc812c8b3986e753f2f2304a7ae477a70974
7
- data.tar.gz: 19c81bacc7df78bbae4b6c9a03007a4ce84ce6c2de230e0e0e6b937e7b8ef4885788f70b36bebcd9cc192ae3aba3b0a7899830cf5ce20182fb95d19a4d2d1843
6
+ metadata.gz: b805ac798aa0f430182e31e9d4b3d924d20624a59406d333f8d8d02ead0d30bece36bf0b127b4b9e04a5cf149cc9e67621ab72f2143f7fcd5c03f70790fedf09
7
+ data.tar.gz: 6883c955de7003baeb2685c369f63532b45e1c25b5859067fdfb2112e31abae6f57e2dc44dd5b06f55d66f3a6b9b778904de864c45905a63cdd9516719d59367
@@ -7,7 +7,7 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
 
9
9
  steps:
10
- - uses: actions/checkout@v2
10
+ - uses: actions/checkout@v3
11
11
  - uses: ruby/setup-ruby@v1
12
12
  with:
13
13
  bundler-cache: true
@@ -37,29 +37,31 @@ jobs:
37
37
  - ruby: 2.7
38
38
  - ruby: 2.7
39
39
  prepend: true
40
- - ruby: 3.0
41
- - ruby: 3.0
40
+ - ruby: "3.0"
41
+ - ruby: "3.0"
42
42
  prepend: true
43
- - ruby: 3.0
43
+ - ruby: "3.0"
44
44
  gemfile: gems/instruments.gemfile
45
45
  test_features: "instruments"
46
- - ruby: 3.0
46
+ - ruby: "3.0"
47
47
  gemfile: gems/instruments.gemfile
48
48
  prepend: true
49
49
  test_features: "instruments"
50
- - ruby: 3.0
50
+ - ruby: "3.0"
51
51
  gemfile: gems/sidekiq.gemfile
52
52
  test_features: "sidekiq_install"
53
-
53
+ - ruby: 3.1
54
+ - ruby: 3.2
54
55
  env:
55
56
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
56
57
  SCOUT_TEST_FEATURES: ${{ matrix.test_features }}
57
58
  SCOUT_USE_PREPEND: ${{ matrix.prepend }}
58
59
 
59
- runs-on: ubuntu-latest
60
+ # https://github.com/ruby/setup-ruby/issues/496
61
+ runs-on: ${{ matrix.ruby == '2.2' && 'ubuntu-20.04' || 'ubuntu-latest' }}
60
62
 
61
63
  steps:
62
- - uses: actions/checkout@v2
64
+ - uses: actions/checkout@v3
63
65
  - uses: ruby/setup-ruby@v1
64
66
  with:
65
67
  bundler-cache: true
data/CHANGELOG.markdown CHANGED
@@ -1,5 +1,14 @@
1
1
  # Unreleased
2
2
 
3
+ # 5.3.5
4
+ * Fix adding instrumentation of ActiveRecord after configuration has initialized for Rails versions greater than 3. (#465)
5
+ * Fix typo with double use of PercentilePolicy, instead of PercentPolicy, for scoring. (#468)
6
+ * Fix span annotations/desc for external service requests with the use of prepend. (#471)
7
+ * Fix ActiveSupport methods and replace them with non ActiveSupport methods. (#474)
8
+
9
+ # 5.3.4
10
+ Unused.
11
+
3
12
  # 5.3.3
4
13
 
5
14
  * Fix double firing of Puma `on_worker_boot` when preloading. (#463)
@@ -66,7 +66,7 @@ module ScoutApm
66
66
  defined?(::Rails) &&
67
67
  defined?(::Rails::VERSION) &&
68
68
  defined?(::Rails::VERSION::MAJOR) &&
69
- ::Rails::VERSION::MAJOR.to_i == 3 &&
69
+ ::Rails::VERSION::MAJOR.to_i >= 3 &&
70
70
  ::Rails.respond_to?(:configuration)
71
71
  end
72
72
 
@@ -60,7 +60,7 @@ module ScoutApm
60
60
 
61
61
  module NetHttpInstrumentationPrepend
62
62
  def request(request, *args, &block)
63
- self.class.instrument("HTTP", "request", :ignore_children => true, :desc => request_scout_description(args.first)) do
63
+ self.class.instrument("HTTP", "request", :ignore_children => true, :desc => request_scout_description(request)) do
64
64
  super(request, *args, &block)
65
65
  end
66
66
  end
@@ -53,7 +53,7 @@ module ScoutApm
53
53
  rescue
54
54
  # Do nothing
55
55
  ensure
56
- domain = DEFAULT_DOMAIN if domain.to_s.blank?
56
+ domain = DEFAULT_DOMAIN if (domain.nil? || domain.empty?)
57
57
  domain
58
58
  end
59
59
 
@@ -14,7 +14,7 @@ module ScoutApm
14
14
 
15
15
  def add_default_policies
16
16
  add(SlowPolicy::SpeedPolicy.new(context))
17
- add(SlowPolicy::PercentilePolicy.new(context))
17
+ add(SlowPolicy::PercentPolicy.new(context))
18
18
  add(SlowPolicy::AgePolicy.new(context))
19
19
  add(SlowPolicy::PercentilePolicy.new(context))
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module ScoutApm
2
- VERSION = "5.3.3"
2
+ VERSION = "5.3.5"
3
3
  end
data/test/test_helper.rb CHANGED
@@ -65,6 +65,32 @@ class FakeEnvironment
65
65
  end
66
66
  end
67
67
 
68
+ def fake_rails(version)
69
+ Kernel.const_set("Rails", Module.new)
70
+ Kernel.const_set("ActionController", Module.new)
71
+ r = Kernel.const_get("Rails")
72
+ r.const_set("VERSION", Module.new)
73
+ v = r.const_get("VERSION")
74
+ v.const_set("MAJOR", version)
75
+
76
+ assert_equal version, Rails::VERSION::MAJOR
77
+ end
78
+
79
+ def clean_fake_rails
80
+ Kernel.send(:remove_const, "Rails") if defined?(Kernel::Rails)
81
+ Kernel.send(:remove_const, "ActionController") if defined?(Kernel::ActionController)
82
+ end
83
+
84
+ def fake_sinatra
85
+ Kernel.const_set("Sinatra", Module.new)
86
+ s = Kernel.const_get("Sinatra")
87
+ s.const_set("Base", Module.new)
88
+ end
89
+
90
+ def clean_fake_sinatra
91
+ Kernel.const_unset("Sinatra") if defined?(Kernel::Sinatra)
92
+ end
93
+
68
94
  # Helpers available to all tests
69
95
  class Minitest::Test
70
96
  def setup
@@ -29,32 +29,4 @@ class EnvironmentTest < Minitest::Test
29
29
  def test_framework_ruby
30
30
  assert_equal :ruby, ScoutApm::Environment.send(:new).framework
31
31
  end
32
-
33
- ############################################################
34
-
35
- def fake_rails(version)
36
- Kernel.const_set("Rails", Module.new)
37
- Kernel.const_set("ActionController", Module.new)
38
- r = Kernel.const_get("Rails")
39
- r.const_set("VERSION", Module.new)
40
- v = r.const_get("VERSION")
41
- v.const_set("MAJOR", version)
42
-
43
- assert_equal version, Rails::VERSION::MAJOR
44
- end
45
-
46
- def clean_fake_rails
47
- Kernel.send(:remove_const, "Rails") if defined?(Kernel::Rails)
48
- Kernel.send(:remove_const, "ActionController") if defined?(Kernel::ActionController)
49
- end
50
-
51
- def fake_sinatra
52
- Kernel.const_set("Sinatra", Module.new)
53
- s = Kernel.const_get("Sinatra")
54
- s.const_set("Base", Module.new)
55
- end
56
-
57
- def clean_fake_sinatra
58
- Kernel.const_unset("Sinatra") if defined?(Kernel::Sinatra)
59
- end
60
32
  end
@@ -24,6 +24,36 @@ class ActiveRecordTest < Minitest::Test
24
24
  class User < ActiveRecord::Base
25
25
  end
26
26
 
27
+ class DumbRailsConfig
28
+ def self.after_initialize; end
29
+ end
30
+
31
+ def test_old_rails_initialization
32
+ recorder = FakeRecorder.new
33
+ agent_context.recorder = recorder
34
+ old_rails_version = (1..2).to_a.sample
35
+ fake_rails(old_rails_version)
36
+
37
+ ::Rails.expects(:configuration).never
38
+
39
+ instrument = ScoutApm::Instruments::ActiveRecord.new(agent_context)
40
+ instrument.install(prepend: false)
41
+ clean_fake_rails
42
+ end
43
+
44
+ def test_modern_rails_initialization
45
+ recorder = FakeRecorder.new
46
+ agent_context.recorder = recorder
47
+ modern_rails_version = (3..7).to_a.sample
48
+ fake_rails(modern_rails_version)
49
+
50
+ ::Rails.expects(:configuration).returns(DumbRailsConfig).once
51
+
52
+ instrument = ScoutApm::Instruments::ActiveRecord.new(agent_context)
53
+ instrument.install(prepend: false)
54
+ clean_fake_rails
55
+ end
56
+
27
57
  def test_instrumentation
28
58
  recorder = FakeRecorder.new
29
59
  agent_context.recorder = recorder
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.3
4
+ version: 5.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes
8
8
  - Andre Lewis
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-12-09 00:00:00.000000000 Z
12
+ date: 2023-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -479,7 +479,7 @@ homepage: https://github.com/scoutapp/scout_apm_ruby
479
479
  licenses:
480
480
  - MIT
481
481
  metadata: {}
482
- post_install_message:
482
+ post_install_message:
483
483
  rdoc_options: []
484
484
  require_paths:
485
485
  - lib
@@ -495,8 +495,72 @@ required_rubygems_version: !ruby/object:Gem::Requirement
495
495
  - !ruby/object:Gem::Version
496
496
  version: '0'
497
497
  requirements: []
498
- rubygems_version: 3.0.3
499
- signing_key:
498
+ rubygems_version: 3.0.8
499
+ signing_key:
500
500
  specification_version: 4
501
501
  summary: Ruby application performance monitoring
502
- test_files: []
502
+ test_files:
503
+ - test/data/config_test_1.yml
504
+ - test/test_helper.rb
505
+ - test/tmp/README.md
506
+ - test/unit/agent_context_test.rb
507
+ - test/unit/agent_test.rb
508
+ - test/unit/auto_instrument/anonymous_block_value.rb
509
+ - test/unit/auto_instrument/assignments-instrumented.rb
510
+ - test/unit/auto_instrument/assignments.rb
511
+ - test/unit/auto_instrument/controller-ast.txt
512
+ - test/unit/auto_instrument/controller-instrumented.rb
513
+ - test/unit/auto_instrument/controller.rb
514
+ - test/unit/auto_instrument/hanging_method.rb
515
+ - test/unit/auto_instrument/rescue_from-instrumented.rb
516
+ - test/unit/auto_instrument/rescue_from.rb
517
+ - test/unit/auto_instrument_test.rb
518
+ - test/unit/background_job_integrations/sidekiq_test.rb
519
+ - test/unit/config_test.rb
520
+ - test/unit/context_test.rb
521
+ - test/unit/db_query_metric_set_test.rb
522
+ - test/unit/db_query_metric_stats_test.rb
523
+ - test/unit/environment_test.rb
524
+ - test/unit/error_service/error_buffer_test.rb
525
+ - test/unit/error_service/ignored_exceptions_test.rb
526
+ - test/unit/extensions/periodic_callbacks_test.rb
527
+ - test/unit/extensions/transaction_callbacks_test.rb
528
+ - test/unit/external_service_metric_set_test.rb
529
+ - test/unit/external_service_metric_stats_test.rb
530
+ - test/unit/fake_store_test.rb
531
+ - test/unit/git_revision_test.rb
532
+ - test/unit/histogram_test.rb
533
+ - test/unit/ignored_uris_test.rb
534
+ - test/unit/instruments/active_record_test.rb
535
+ - test/unit/instruments/http_client_test.rb
536
+ - test/unit/instruments/http_test.rb
537
+ - test/unit/instruments/moped_test.rb
538
+ - test/unit/instruments/net_http_test.rb
539
+ - test/unit/instruments/percentile_sampler_test.rb
540
+ - test/unit/instruments/redis_test.rb
541
+ - test/unit/instruments/typhoeus_test.rb
542
+ - test/unit/layaway_test.rb
543
+ - test/unit/layer_children_set_test.rb
544
+ - test/unit/layer_converters/depth_first_walker_test.rb
545
+ - test/unit/layer_converters/metric_converter_test.rb
546
+ - test/unit/layer_converters/stubs.rb
547
+ - test/unit/limited_layer_test.rb
548
+ - test/unit/logger_test.rb
549
+ - test/unit/metric_set_test.rb
550
+ - test/unit/remote/message_test.rb
551
+ - test/unit/remote/route_test.rb
552
+ - test/unit/remote/server_test.rb
553
+ - test/unit/request_histograms_test.rb
554
+ - test/unit/scored_item_set_test.rb
555
+ - test/unit/serializers/payload_serializer_test.rb
556
+ - test/unit/slow_request_policy_test.rb
557
+ - test/unit/sql_sanitizer_test.rb
558
+ - test/unit/store_test.rb
559
+ - test/unit/tracer_test.rb
560
+ - test/unit/tracked_request_test.rb
561
+ - test/unit/transaction_test.rb
562
+ - test/unit/transaction_time_consumed_test.rb
563
+ - test/unit/utils/active_record_metric_name_test.rb
564
+ - test/unit/utils/backtrace_parser_test.rb
565
+ - test/unit/utils/numbers_test.rb
566
+ - test/unit/utils/scm.rb