scout_apm 2.6.7 → 2.6.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3bd965754661b15110fa6548e3aec419716fc4c61def62066d8ec21531e53ad3
4
- data.tar.gz: c0d131917b7907de192d5253040931ac2e61401de16a93cc7bb31b50a62d939b
3
+ metadata.gz: d99ef266b1387f4a51d49467a3d6cad6499f3054834d8695b5e0f3af1d7a36b3
4
+ data.tar.gz: 04f505997a14d3312de48905b27aab38beedf846de0e7c9411d4e71e1b4477c4
5
5
  SHA512:
6
- metadata.gz: f93702e2b4ad0c1ad7a57bec3b1a1548bcb7209682c32a25e8b0404040be3a083c9816abfd6aa01717a52ffbca5a92070f4640a86e100e286507e21f5458cfd1
7
- data.tar.gz: 52d947b2401731e7e01f8c641d4e380d6e1f21f2488d7d5539683788e9b46b98c43bf93578237e5f43d235cee7f6f66fa5c3c568def4d07c5b60d491fbf95ec6
6
+ metadata.gz: 5918121a80a2dd6e15c12f2c45ae294c8f2dbb815296b1d63f9dbd5065e97e10312c4c7674a3c89496dc91303c47aa8f2d61b19005f130f40ceceba6ebd170da
7
+ data.tar.gz: 2033f3db42f9f0a3626c540e3beecb68aaf3480a4e88bdbaae43a7fe0a4273c06ad4b15c546b8a4d4051e7b8d96526e80847129dba9a9ed66fd4efa0b27cadc4
@@ -1,3 +1,12 @@
1
+ # 2.6.8
2
+
3
+ * Lock rake version for 1.8.7 to older version (#329)
4
+ * Delete unneeded .DS_Store file that snuck in (#334)
5
+ * Fix typo in "queue_time_ms"
6
+ * Fix Rails 6 deprecation warning at boot time (#337)
7
+ * Fix partial naming on Rails 6.0 (#339)
8
+ * Support Sidekiq 6.1 instrumentation (#340)
9
+
1
10
  # 2.6.7
2
11
 
3
12
  * Remove accidental call to `as_json`
data/Gemfile CHANGED
@@ -10,4 +10,8 @@ if RUBY_VERSION <= "1.8.7"
10
10
  gem "pry", "~> 0.9.12"
11
11
  gem "rake", "~> 10.5"
12
12
  gem "minitest", "~> 5.11.3"
13
+ elsif RUBY_VERSION <= "1.9.3"
14
+ gem "rake", "~> 10.5"
15
+ else
16
+ gem "rake", ">= 12.3.3"
13
17
  end
@@ -40,10 +40,10 @@ module ScoutApm
40
40
  require 'sidekiq/processor' # sidekiq v4 has not loaded this file by this point
41
41
 
42
42
  ::Sidekiq::Processor.class_eval do
43
- def initialize_with_scout(boss)
43
+ def initialize_with_scout(*args)
44
44
  agent = ::ScoutApm::Agent.instance
45
45
  agent.start
46
- initialize_without_scout(boss)
46
+ initialize_without_scout(*args)
47
47
  end
48
48
 
49
49
  alias_method :initialize_without_scout, :initialize
@@ -26,7 +26,7 @@ module ScoutApm
26
26
  # The time in queue of the transaction in ms. If not present, +nil+ is returned as this is unknown.
27
27
  def queue_time_ms
28
28
  # Controller logic
29
- if converter_results[:queue_time] && converter_results[:queue].any?
29
+ if converter_results[:queue_time] && converter_results[:queue_time].any?
30
30
  converter_results[:queue_time].values.first.total_call_time*1000 # ms
31
31
  # Job logic
32
32
  elsif converter_results[:job]
@@ -17,44 +17,61 @@ module ScoutApm
17
17
  @installed
18
18
  end
19
19
 
20
+ def installed!
21
+ @installed = true
22
+ end
23
+
20
24
  def install
21
- # We previously instrumented ActionController::Metal, which missed
22
- # before and after filter timing. Instrumenting Base includes those
23
- # filters, at the expense of missing out on controllers that don't use
24
- # the full Rails stack.
25
- if defined?(::ActionController)
26
- @installed = true
25
+ if !defined?(::ActiveSupport)
26
+ return
27
+ end
28
+
29
+ # The block below runs with `self` equal to the ActionController::Base or ::API module, not this class we're in now. By saving an instance of ourselves into the `this` variable, we can continue accessing what we need.
30
+ this = self
31
+
32
+ ActiveSupport.on_load(:action_controller) do
33
+ if this.installed?
34
+ this.logger.info("Skipping ActionController - Already Ran")
35
+ next
36
+ else
37
+ this.logger.info("Instrumenting ActionController (on_load)")
38
+ this.installed!
39
+ end
27
40
 
41
+ # We previously instrumented ActionController::Metal, which missed
42
+ # before and after filter timing. Instrumenting Base includes those
43
+ # filters, at the expense of missing out on controllers that don't use
44
+ # the full Rails stack.
28
45
  if defined?(::ActionController::Base)
29
- logger.info "Instrumenting ActionController::Base"
46
+ this.logger.info "Instrumenting ActionController::Base"
30
47
  ::ActionController::Base.class_eval do
31
- # include ScoutApm::Tracer
32
48
  include ScoutApm::Instruments::ActionControllerBaseInstruments
33
49
  end
34
50
  end
35
51
 
36
52
  if defined?(::ActionController::Metal)
37
- logger.info "Instrumenting ActionController::Metal"
53
+ this.logger.info "Instrumenting ActionController::Metal"
38
54
  ::ActionController::Metal.class_eval do
39
55
  include ScoutApm::Instruments::ActionControllerMetalInstruments
40
56
  end
41
57
  end
42
58
 
43
59
  if defined?(::ActionController::API)
44
- logger.info "Instrumenting ActionController::Api"
60
+ this.logger.info "Instrumenting ActionController::Api"
45
61
  ::ActionController::API.class_eval do
46
62
  include ScoutApm::Instruments::ActionControllerAPIInstruments
47
63
  end
48
64
  end
49
65
  end
50
66
 
51
- # Returns a new anonymous module each time it is called. So
52
- # we can insert this multiple times into the ancestors
53
- # stack. Otherwise it only exists the first time you include it
54
- # (under Metal, instead of under API) and we miss instrumenting
55
- # before_action callbacks
67
+ ScoutApm::Agent.instance.context.logger.info("Instrumenting ActionController (hook installed)")
56
68
  end
57
69
 
70
+ # Returns a new anonymous module each time it is called. So
71
+ # we can insert this multiple times into the ancestors
72
+ # stack. Otherwise it only exists the first time you include it
73
+ # (under Metal, instead of under API) and we miss instrumenting
74
+ # before_action callbacks
58
75
  def self.build_instrument_module
59
76
  Module.new do
60
77
  def process_action(*args)
@@ -75,13 +75,18 @@ module ScoutApm
75
75
  end
76
76
 
77
77
  module ActionViewPartialRendererInstruments
78
+ # In Rails 6, the signature changed to pass the view & template args directly, as opposed to through the instance var
79
+ # New signature is: def render_partial(view, template)
78
80
  def render_partial(*args)
79
81
  req = ScoutApm::RequestManager.lookup
80
82
 
81
- template_name = @template.virtual_path rescue "Unknown Partial"
83
+ maybe_template = args[1]
84
+
85
+ template_name = @template.virtual_path rescue nil # Works on Rails 3.2 -> end of Rails 5 series
86
+ template_name ||= maybe_template.virtual_path rescue nil # Works on Rails 6 -> 6.0.3
82
87
  template_name ||= "Unknown Partial"
83
- layer_name = template_name + "/Rendering"
84
88
 
89
+ layer_name = template_name + "/Rendering"
85
90
  layer = ScoutApm::Layer.new("View", layer_name)
86
91
  layer.subscopable!
87
92
 
@@ -1,3 +1,3 @@
1
1
  module ScoutApm
2
- VERSION = "2.6.7"
2
+ VERSION = "2.6.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.7
4
+ version: 2.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Haynes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-03-17 00:00:00.000000000 Z
12
+ date: 2020-06-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -281,7 +281,6 @@ files:
281
281
  - lib/scout_apm/instant/middleware.rb
282
282
  - lib/scout_apm/instant_reporting.rb
283
283
  - lib/scout_apm/instrument_manager.rb
284
- - lib/scout_apm/instruments/.DS_Store
285
284
  - lib/scout_apm/instruments/action_controller_rails_2.rb
286
285
  - lib/scout_apm/instruments/action_controller_rails_3_rails4.rb
287
286
  - lib/scout_apm/instruments/action_view.rb
@@ -461,61 +460,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
461
460
  - !ruby/object:Gem::Version
462
461
  version: '0'
463
462
  requirements: []
464
- rubygems_version: 3.0.4
463
+ rubygems_version: 3.0.8
465
464
  signing_key:
466
465
  specification_version: 4
467
466
  summary: Ruby application performance monitoring
468
- test_files:
469
- - test/data/config_test_1.yml
470
- - test/test_helper.rb
471
- - test/tmp/README.md
472
- - test/unit/agent_test.rb
473
- - test/unit/auto_instrument/assignments-instrumented.rb
474
- - test/unit/auto_instrument/assignments.rb
475
- - test/unit/auto_instrument/controller-ast.txt
476
- - test/unit/auto_instrument/controller-instrumented.rb
477
- - test/unit/auto_instrument/controller.rb
478
- - test/unit/auto_instrument/rescue_from-instrumented.rb
479
- - test/unit/auto_instrument/rescue_from.rb
480
- - test/unit/auto_instrument_test.rb
481
- - test/unit/background_job_integrations/sidekiq_test.rb
482
- - test/unit/config_test.rb
483
- - test/unit/context_test.rb
484
- - test/unit/db_query_metric_set_test.rb
485
- - test/unit/db_query_metric_stats_test.rb
486
- - test/unit/environment_test.rb
487
- - test/unit/extensions/periodic_callbacks_test.rb
488
- - test/unit/extensions/transaction_callbacks_test.rb
489
- - test/unit/fake_store_test.rb
490
- - test/unit/git_revision_test.rb
491
- - test/unit/histogram_test.rb
492
- - test/unit/ignored_uris_test.rb
493
- - test/unit/instruments/active_record_test.rb
494
- - test/unit/instruments/net_http_test.rb
495
- - test/unit/instruments/percentile_sampler_test.rb
496
- - test/unit/layaway_test.rb
497
- - test/unit/layer_children_set_test.rb
498
- - test/unit/layer_converters/depth_first_walker_test.rb
499
- - test/unit/layer_converters/metric_converter_test.rb
500
- - test/unit/layer_converters/stubs.rb
501
- - test/unit/limited_layer_test.rb
502
- - test/unit/logger_test.rb
503
- - test/unit/metric_set_test.rb
504
- - test/unit/remote/test_message.rb
505
- - test/unit/remote/test_router.rb
506
- - test/unit/remote/test_server.rb
507
- - test/unit/request_histograms_test.rb
508
- - test/unit/scored_item_set_test.rb
509
- - test/unit/serializers/payload_serializer_test.rb
510
- - test/unit/slow_job_policy_test.rb
511
- - test/unit/slow_request_policy_test.rb
512
- - test/unit/sql_sanitizer_test.rb
513
- - test/unit/store_test.rb
514
- - test/unit/tracer_test.rb
515
- - test/unit/tracked_request_test.rb
516
- - test/unit/transaction_test.rb
517
- - test/unit/transaction_time_consumed_test.rb
518
- - test/unit/utils/active_record_metric_name_test.rb
519
- - test/unit/utils/backtrace_parser_test.rb
520
- - test/unit/utils/numbers_test.rb
521
- - test/unit/utils/scm.rb
467
+ test_files: []