scout_apm 5.1.1 → 5.2.0

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: 5a1da3776ca231a4d81c9ab5935e6b644ab46ae5609cef60402ccd5258e07795
4
- data.tar.gz: f583776f39fa426aa43d1942bd83e4bcd23ca3a6f71a2e883df22a74cb2db868
3
+ metadata.gz: 81ad3b683899407ed049b7267d6d79a84d5afac011445d1078f4342c345c7ace
4
+ data.tar.gz: 29e141854923fa21c57ca3fcc7ca9e4cc96dbd741c36c0586e7fd2cd7a8186f8
5
5
  SHA512:
6
- metadata.gz: bc2f10c76ea8abbb6f74cbe86cbd0e0d1265143a19008307609be35adb57737f474c9a2f59545e2f36b00b5006c5f1b9726f59e70c3e327e6487eb2445e07df6
7
- data.tar.gz: 8863c891bbd5f1e87d56a06f8275cbcf711b15964116cbddbb648398825eed65fa6ce73cd3848815e8ab8a1eec1f8a2e4a878682e2d47d457778786532ee3db4
6
+ metadata.gz: a857678f6d91c709fbbdfb30409339f37e99cd83260cec9d3808f81638245de03cf4b0721270203f0ee619cc56b06fc3baa795a10e859c3068e0e2c36a2247b2
7
+ data.tar.gz: 972da0997d251c5704291e60e390916a417de3036aadcada469540acd20520f4edd95b3b76da9202734755bc37c3a9a22e44916c23e74c9199d3c6a7a2447797
@@ -36,6 +36,9 @@ jobs:
36
36
  bundler: 1.17.3
37
37
  - ruby: 2.7
38
38
  - ruby: 3.0
39
+ - ruby: 3.0
40
+ gemfile: gems/sidekiq.gemfile
41
+ test_features: "sidekiq_install"
39
42
 
40
43
  env:
41
44
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
data/CHANGELOG.markdown CHANGED
@@ -1,5 +1,9 @@
1
1
  # Unreleased
2
2
 
3
+ # 5.2.0
4
+
5
+ * Use Sidekiq lifecycle hooks to start Scout agent on Sidekiq start. (#449)
6
+
3
7
  # 5.1.1
4
8
 
5
9
  * Improvements to SqlServer scrubbing in SqlSanitizer (#422)
@@ -0,0 +1,4 @@
1
+ eval_gemfile("../Gemfile")
2
+
3
+ # https://github.com/scoutapp/scout_apm_ruby/issues/449
4
+ gem 'sidekiq', '>= 6.5.0'
@@ -37,17 +37,11 @@ module ScoutApm
37
37
  end
38
38
 
39
39
  def install_processor
40
- require 'sidekiq/processor' # sidekiq v4 has not loaded this file by this point
41
-
42
- ::Sidekiq::Processor.class_eval do
43
- def initialize_with_scout(*args)
40
+ ::Sidekiq.configure_server do |config|
41
+ config.on(:startup) do
44
42
  agent = ::ScoutApm::Agent.instance
45
43
  agent.start
46
- initialize_without_scout(*args)
47
44
  end
48
-
49
- alias_method :initialize_without_scout, :initialize
50
- alias_method :initialize, :initialize_with_scout
51
45
  end
52
46
  end
53
47
  end
@@ -217,6 +217,7 @@ module ScoutApm
217
217
 
218
218
  def initialize(timestamp, context)
219
219
  @timestamp = timestamp
220
+ @context = context
220
221
 
221
222
  @request_traces = ScoredItemSet.new(context.config.value('max_traces'))
222
223
  @job_traces = ScoredItemSet.new(context.config.value('max_traces'))
@@ -230,6 +231,11 @@ module ScoutApm
230
231
  @jobs = Hash.new
231
232
  end
232
233
 
234
+ def logger
235
+ @context.logger
236
+ end
237
+ private :logger
238
+
233
239
  # Merges another StoreReportingPeriod into this one
234
240
  def merge(other)
235
241
  self.
@@ -1,3 +1,3 @@
1
1
  module ScoutApm
2
- VERSION = "5.1.1"
2
+ VERSION = "5.2.0"
3
3
  end
@@ -3,8 +3,25 @@ require 'scout_apm/request_manager'
3
3
  require 'scout_apm/background_job_integrations/sidekiq'
4
4
 
5
5
  class SidekiqTest < Minitest::Test
6
+ SidekiqIntegration = ScoutApm::BackgroundJobIntegrations::Sidekiq
6
7
  SidekiqMiddleware = ScoutApm::BackgroundJobIntegrations::SidekiqMiddleware
7
8
 
9
+ ########################################
10
+ # Install
11
+ ########################################
12
+ if (ENV["SCOUT_TEST_FEATURES"] || "").include?("sidekiq_install")
13
+ require 'sidekiq'
14
+
15
+ # Sidekiq::CLI needs to be defined in order for `Sidekiq.configure_server` to work
16
+ Sidekiq::CLI = nil
17
+
18
+ def test_starts_on_startup
19
+ ::ScoutApm::Agent.any_instance.expects(:start)
20
+ SidekiqIntegration.new.install
21
+ Sidekiq.options[:lifecycle_events][:startup].map(&:call)
22
+ end
23
+ end
24
+
8
25
  ########################################
9
26
  # Middleware
10
27
  ########################################
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.1.1
4
+ version: 5.2.0
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: 2021-12-14 00:00:00.000000000 Z
12
+ date: 2022-06-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -237,6 +237,7 @@ files:
237
237
  - gems/rails4.gemfile
238
238
  - gems/rails5.gemfile
239
239
  - gems/rails6.gemfile
240
+ - gems/sidekiq.gemfile
240
241
  - gems/typhoeus.gemfile
241
242
  - lib/scout_apm.rb
242
243
  - lib/scout_apm/agent.rb
@@ -472,7 +473,7 @@ homepage: https://github.com/scoutapp/scout_apm_ruby
472
473
  licenses:
473
474
  - MIT
474
475
  metadata: {}
475
- post_install_message:
476
+ post_install_message:
476
477
  rdoc_options: []
477
478
  require_paths:
478
479
  - lib
@@ -488,8 +489,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
488
489
  - !ruby/object:Gem::Version
489
490
  version: '0'
490
491
  requirements: []
491
- rubygems_version: 3.0.3
492
- signing_key:
492
+ rubygems_version: 3.3.7
493
+ signing_key:
493
494
  specification_version: 4
494
495
  summary: Ruby application performance monitoring
495
496
  test_files: []