skylight 5.3.2 → 5.3.3

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: f70688b41eae2aba12100dfdc0fa2376de752498b870b951a215779dfab6f402
4
- data.tar.gz: 07141a17727dd08c96059361ce86168ac45a34ff222ef8ebb77aa29ad6effce9
3
+ metadata.gz: f3b769eb5f54b2400e4e2ba1678a5e45e1bdf3aff9dc205274387317035e606b
4
+ data.tar.gz: 1bf4191e377224dfb2c5e064dc6391462c2005a6bf3c8cc658feaa6b6d67e002
5
5
  SHA512:
6
- metadata.gz: 4cae620358ed7fa0eabad6464346899217813cdccacc68980a0abd6a4b31c0416b0b65b0d66b6cf7f7746f73ca0ff00e689b72011990d1482c012b22b8f5fdb5
7
- data.tar.gz: 75cfe4636a13c3fa194788f5153b114c816b249c2f57e3a7358df44a9fef4818fa452fe02268f4a01c4b4a7703bacff5394dd256c194de1c586cd5a38802c3e2
6
+ metadata.gz: 830f58c5a32ffaf48584fe0769508451e2b0719fb0fc3ed9c3c13a031fff5706e94485a9bf11dacbf0c9b48e95cfd4df07d875eb097c54e90fcf018858eca133
7
+ data.tar.gz: 1bcdb766cbb4040a9f0734ebeb2a727ddc665bef8c58842b69a48dc33a965b0985ae4dd38cea714f2acca4ab12b79a55c37b5c1bba43985541c68ff80687d7f9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 5.3.3 (July 13, 2022)
2
+
3
+ - [IMPROVEMENT] Track the original class/method name for Sidekiq delayed object proxies
4
+ - [BUGFIX] Fix `mongoid` probe not activating correctly
5
+ - [BUGFIX] Fix `mongo` probe not instrumenting clients created before Skylight initialization
6
+
1
7
  ## 5.3.2 (April 6, 2022)
2
8
 
3
9
  - [BUGFIX] Fix case-sensitivity issue when computing relative paths
data/ext/extconf.rb CHANGED
@@ -43,19 +43,19 @@ end
43
43
  include Skylight::Util
44
44
 
45
45
  SKYLIGHT_INSTALL_LOG = File.expand_path("install.log", __dir__)
46
- SKYLIGHT_REQUIRED = ENV.key?("SKYLIGHT_REQUIRED") && ENV["SKYLIGHT_REQUIRED"] !~ /^false$/i
47
- SKYLIGHT_FETCH_LIB = !ENV.key?("SKYLIGHT_FETCH_LIB") || ENV["SKYLIGHT_FETCH_LIB"] !~ /^false$/i
46
+ SKYLIGHT_REQUIRED = ENV.key?("SKYLIGHT_REQUIRED") && ENV.fetch("SKYLIGHT_REQUIRED", nil) !~ /^false$/i
47
+ SKYLIGHT_FETCH_LIB = !ENV.key?("SKYLIGHT_FETCH_LIB") || ENV.fetch("SKYLIGHT_FETCH_LIB", nil) !~ /^false$/i
48
48
 
49
49
  # Directory where skylight.h exists
50
- SKYLIGHT_HDR_PATH = ENV["SKYLIGHT_HDR_PATH"] || ENV["SKYLIGHT_LIB_PATH"] || "."
50
+ SKYLIGHT_HDR_PATH = ENV.fetch("SKYLIGHT_HDR_PATH") { ENV.fetch("SKYLIGHT_LIB_PATH", ".") }
51
51
  SKYLIGHT_LIB_PATH =
52
- ENV["SKYLIGHT_LIB_PATH"] || File.expand_path("../../lib/skylight/native/#{Platform.tuple}", __FILE__)
52
+ ENV.fetch("SKYLIGHT_LIB_PATH") { File.expand_path("../../lib/skylight/native/#{Platform.tuple}", __FILE__) }
53
53
 
54
- SKYLIGHT_SOURCE_URL = ENV["SKYLIGHT_SOURCE_URL"]
55
- SKYLIGHT_VERSION = ENV["SKYLIGHT_VERSION"]
56
- SKYLIGHT_CHECKSUM = ENV["SKYLIGHT_CHECKSUM"]
54
+ SKYLIGHT_SOURCE_URL = ENV.fetch("SKYLIGHT_SOURCE_URL", nil)
55
+ SKYLIGHT_VERSION = ENV.fetch("SKYLIGHT_VERSION", nil)
56
+ SKYLIGHT_CHECKSUM = ENV.fetch("SKYLIGHT_CHECKSUM", nil)
57
57
 
58
- SKYLIGHT_EXT_STRICT = ENV.key?("SKYLIGHT_EXT_STRICT") && ENV["SKYLIGHT_EXT_STRICT"] =~ /^true$/i
58
+ SKYLIGHT_EXT_STRICT = ENV.key?("SKYLIGHT_EXT_STRICT") && ENV.fetch("SKYLIGHT_EXT_STRICT", nil) =~ /^true$/i
59
59
 
60
60
  # Setup logger
61
61
  LOG = Logger.new(MultiIO.new($stdout, File.open(SKYLIGHT_INSTALL_LOG, "a")))
@@ -59,13 +59,13 @@ module Skylight
59
59
  end
60
60
 
61
61
  def self.libskylight_path
62
- ENV["SKYLIGHT_LIB_PATH"] || File.expand_path("../native/#{Util::Platform.tuple}", __FILE__)
62
+ ENV.fetch("SKYLIGHT_LIB_PATH") { File.expand_path("../native/#{Util::Platform.tuple}", __FILE__) }
63
63
  end
64
64
 
65
- skylight_required = ENV.key?("SKYLIGHT_REQUIRED") && ENV["SKYLIGHT_REQUIRED"] !~ /^false$/i
65
+ skylight_required = ENV.key?("SKYLIGHT_REQUIRED") && ENV.fetch("SKYLIGHT_REQUIRED", nil) !~ /^false$/i
66
66
 
67
67
  begin
68
- unless ENV.key?("SKYLIGHT_DISABLE_AGENT") && ENV["SKYLIGHT_DISABLE_AGENT"] !~ /^false$/i
68
+ unless ENV.key?("SKYLIGHT_DISABLE_AGENT") && ENV.fetch("SKYLIGHT_DISABLE_AGENT", nil) !~ /^false$/i
69
69
  lib = "#{libskylight_path}/libskylight.#{Util::Platform.libext}"
70
70
 
71
71
  if File.exist?(lib)
@@ -5,7 +5,20 @@ module Skylight
5
5
 
6
6
  class Probe
7
7
  def install
8
- ::Mongo::Monitoring::Global.subscribe(::Mongo::Monitoring::COMMAND, Subscriber.new)
8
+ subscriber = Subscriber.new
9
+
10
+ # From the mongo driver:
11
+ #
12
+ # > Global subscriptions must be established prior to creating
13
+ # > clients. When a client is constructed it copies subscribers from
14
+ # > the Global module; subsequent subscriptions or unsubscriptions
15
+ # > on the Global module have no effect on already created clients.
16
+ #
17
+ # So, for existing clients created before the Skylight initializer
18
+ # runs, we'll have to subscribe to those individually.
19
+ ::Mongoid::Clients.clients.each { |_name, client| client.subscribe(::Mongo::Monitoring::COMMAND, subscriber) }
20
+
21
+ ::Mongo::Monitoring::Global.subscribe(::Mongo::Monitoring::COMMAND, subscriber)
9
22
  end
10
23
  end
11
24
 
@@ -1,13 +1,6 @@
1
- module Skylight
2
- module Probes
3
- module Mongoid
4
- class Probe
5
- def install
6
- Skylight::Probes.probe(:mongo)
7
- end
8
- end
9
- end
10
-
11
- register(:mongoid, "Mongoid", "mongoid", Mongoid::Probe.new)
12
- end
13
- end
1
+ # Older versions of the mongoid uses the moped under-the-hood, while newer
2
+ # verions uses the official driver. It used to be that the the mongoid probe
3
+ # exists to detect and enable either one of those underlying probes, but at
4
+ # this point we no longer support moped, so this is now just an alias for the
5
+ # mongo probe.
6
+ require_relative "mongo"
@@ -153,7 +153,7 @@ module Skylight
153
153
  return false unless sk_config
154
154
 
155
155
  key = "SKYLIGHT_ENABLED"
156
- activate = ENV.key?(key) ? ENV[key] !~ /^false$/i : environments.include?(Rails.env.to_s)
156
+ activate = ENV.key?(key) ? ENV.fetch(key, nil) !~ /^false$/i : environments.include?(Rails.env.to_s)
157
157
 
158
158
  show_worker_activation_warning(sk_config) if activate
159
159
 
@@ -21,7 +21,7 @@ module Skylight
21
21
 
22
22
  def call(worker, job, queue)
23
23
  t { "Sidekiq middleware beginning trace" }
24
- title = job["wrapped"] || job["class"]
24
+ title = job["display_class"] || job["wrapped"] || job["class"]
25
25
 
26
26
  # TODO: Using hints here would be ideal but requires further refactoring
27
27
  meta =
@@ -18,7 +18,9 @@ module Skylight
18
18
  @config[:user_config_path] ||
19
19
  begin
20
20
  require "etc"
21
- home_dir = ENV["HOME"] || Etc.getpwuid.dir || (ENV["USER"] && File.expand_path("~#{ENV["USER"]}"))
21
+ home_dir =
22
+ ENV.fetch("HOME", nil) || Etc.getpwuid.dir ||
23
+ (ENV.fetch("USER", nil) && File.expand_path("~#{ENV.fetch("USER", nil)}"))
22
24
  if home_dir
23
25
  File.join(home_dir, ".skylight")
24
26
  else
@@ -31,7 +33,7 @@ module Skylight
31
33
  end
32
34
 
33
35
  def disable_dev_warning?
34
- disable_dev_warning || ENV["SKYLIGHT_DISABLE_DEV_WARNING"] =~ /^true$/i
36
+ disable_dev_warning || ENV.fetch("SKYLIGHT_DISABLE_DEV_WARNING", nil) =~ /^true$/i
35
37
  end
36
38
 
37
39
  def disable_env_warning?
@@ -12,7 +12,7 @@ module Skylight
12
12
  # Ruby doesn't know that it's on a musl-based platform. `ldd` is the
13
13
  # only reliable way to detect musl that we've found.
14
14
  # See https://github.com/skylightio/skylight-ruby/issues/92
15
- ENV["SKYLIGHT_MUSL"] || `ldd --version 2>&1` =~ /musl/ ? "linux-musl" : "linux"
15
+ ENV.fetch("SKYLIGHT_MUSL") { `ldd --version 2>&1` =~ /musl/ } ? "linux-musl" : "linux"
16
16
  when /darwin/
17
17
  "darwin"
18
18
  when /freebsd/
@@ -3,5 +3,5 @@ module Skylight
3
3
  # for compatibility with semver when it is parsed by the rust agent.
4
4
  # This string will be transformed in the gemspec to "5.0.0.alpha"
5
5
  # to conform with rubygems.
6
- VERSION = "5.3.2".freeze
6
+ VERSION = "5.3.3".freeze
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skylight
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.2
4
+ version: 5.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tilde, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-06 00:00:00.000000000 Z
11
+ date: 2022-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 1.1.1
103
+ version: 1.2.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 1.1.1
110
+ version: 1.2.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.26.1
145
+ version: 1.31.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.26.1
152
+ version: 1.31.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: simplecov
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -385,7 +385,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
385
385
  - !ruby/object:Gem::Version
386
386
  version: '0'
387
387
  requirements: []
388
- rubygems_version: 3.3.3
388
+ rubygems_version: 3.2.15
389
389
  signing_key:
390
390
  specification_version: 4
391
391
  summary: Skylight is a smart profiler for Rails, Sinatra, and other Ruby apps.