skylight 5.3.0 → 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: ab247cb921b7d63dec0fc2fd7c6987a862986953f06765ae3472f59fb3c5ccbd
4
- data.tar.gz: da9348e64a843ee5547808ead23c14b904d61c18431eebbf60e8aa36f41db2ef
3
+ metadata.gz: f3b769eb5f54b2400e4e2ba1678a5e45e1bdf3aff9dc205274387317035e606b
4
+ data.tar.gz: 1bf4191e377224dfb2c5e064dc6391462c2005a6bf3c8cc658feaa6b6d67e002
5
5
  SHA512:
6
- metadata.gz: db622c8b9bcada4c1806d4891632587510e4ee06bee1ddc265d29bbf816aef404e403a8b5e1aa584342f1867089aba945de6de3dd3d8c13d38c97e3fce526be9
7
- data.tar.gz: 79445c8d91cda531854c1e7ae9799be4b78e921fe7c4588a1bc4e1c5292546d34ac237c35d973759e9a6bc071bbe7fcd567079c71d8c462d76e93ba0becdf684
6
+ metadata.gz: 830f58c5a32ffaf48584fe0769508451e2b0719fb0fc3ed9c3c13a031fff5706e94485a9bf11dacbf0c9b48e95cfd4df07d875eb097c54e90fcf018858eca133
7
+ data.tar.gz: 1bcdb766cbb4040a9f0734ebeb2a727ddc665bef8c58842b69a48dc33a965b0985ae4dd38cea714f2acca4ab12b79a55c37b5c1bba43985541c68ff80687d7f9
data/CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
- ## 5.3.0 (February, 9, 2022)
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
+
7
+ ## 5.3.2 (April 6, 2022)
8
+
9
+ - [BUGFIX] Fix case-sensitivity issue when computing relative paths
10
+
11
+ ## 5.3.1 (February 28, 2022)
12
+
13
+ - [BUGFIX] Fix Elasticsearch integration for gem versions >= 8.
14
+
15
+ ## 5.3.0 (February 9, 2022)
2
16
 
3
17
  - [FEATURE] Support for Rails 7's `load_async`.
4
18
  - [IMPROVEMENT] `skylight doctor` now checks glibc compatibility.
@@ -17,7 +31,7 @@
17
31
 
18
32
  - [BUGFIX] Correct ruby version requirement in skylight.gemspec
19
33
 
20
- ## 5.1.0 (May 24, 2021)
34
+ ## 5.1.0 (May 24, 2021) [YANKED]
21
35
 
22
36
  - [FEATURE] Add experimental tcp-based `skylightd` (may be enabled with `SKYLIGHT_ENABLE_TCP=true`)
23
37
 
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")))
data/ext/libskylight.yml CHANGED
@@ -1,9 +1,9 @@
1
- version: "5.1.0-6812c12"
1
+ version: "5.1.0-cd7d6af"
2
2
  checksums:
3
- x86-linux: "d3acbbcd14209e8564226e005db2163b7d1ae49133eb250a7901ff2687abe330"
4
- x86_64-linux: "dfb1062572780285795eef2e99d32ff3ad6be1c944c1a6add442488f7a4a9b22"
5
- x86_64-linux-musl: "af09469f20c666a15ccbb910d8906c6a69a99f87f69db6cbba41908baf3fcef2"
6
- x86_64-darwin: "eb4cb7b9301e0b1f88623203a4476bdabf299ec62556dc40bedda78c5eeb1437"
7
- aarch64-linux: "3d5e8743c4dfdde5be3b6162c75b0351ff0be5658819c1fec9f3a936c4c81a32"
8
- aarch64-linux-musl: "30705f76e333f4883a9481a34bc2dfeb7e9fd6f98c0cf8afbe63f232f3ceb1e5"
9
- aarch64-darwin: "9f8ffc752b0e17bde587e5a5510b17554096b2b65fa2e19203ff1ee3a3145b1d"
3
+ x86-linux: "921381c014b87e67fa2049e9891377f737b5abb10963228ddcd65caede7b58d2"
4
+ x86_64-linux: "e89f0ec3f39ecca060b757fcd1b9d8f38e5846f65579785454bb69a968e8528f"
5
+ x86_64-linux-musl: "78239bc7581c124c2a00cfbc42ec6cf73e7ed280ed1a27d85bb915531a683f1a"
6
+ x86_64-darwin: "faa7363ada4bf476511f6700856fd91b9d61fed055297417ce41d83aa11fe07c"
7
+ aarch64-linux: "e172515a6f7923552e842d21319b3630bdc6e264b6a434b43d2db682dcde18cc"
8
+ aarch64-linux-musl: "1665adf149bd2c12e409f387de5d796ef9e55d4cfd9a886f69c42cab59a51926"
9
+ aarch64-darwin: "027bec103668e89f318b55ddc2a48ca5c84c7a6dcd1dd273cc9b7b46d918ef12"
@@ -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)
@@ -3,8 +3,17 @@ module Skylight
3
3
  module Elasticsearch
4
4
  class Probe
5
5
  def install
6
+ const =
7
+ if defined?(::Elasticsearch::Transport::Transport::Base)
8
+ ::Elasticsearch::Transport::Transport::Base
9
+ elsif defined?(::Elastic::Transport::Transport::Base)
10
+ ::Elastic::Transport::Transport::Base
11
+ else
12
+ return false
13
+ end
14
+
6
15
  # Prepending doesn't work here since this a module that's already been included
7
- ::Elasticsearch::Transport::Transport::Base.class_eval do
16
+ const.class_eval do
8
17
  alias_method :perform_request_without_sk, :perform_request
9
18
  def perform_request(method, path, *args, &block)
10
19
  ActiveSupport::Notifications.instrument(
@@ -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"
@@ -78,15 +78,14 @@ module Skylight
78
78
  end
79
79
 
80
80
  def add_path(path)
81
- root = Pathname.new(path)
82
- Pathname
83
- .glob(root.join("./**/*.rb"))
84
- .each do |f|
85
- name = f.relative_path_from(root).sub_ext("").to_s
86
- raise "duplicate probe name: #{name}; original=#{available[name]}; new=#{f}" if available.key?(name)
87
-
88
- available[name] = f
89
- end
81
+ Dir.glob("**/*.rb", base: path) do |f|
82
+ name = Pathname.new(f).sub_ext("").to_s
83
+ full_path = File.expand_path(f, path)
84
+
85
+ raise "duplicate probe name: #{name}; original=#{available[name]}; new=#{full_path}" if available.key?(name)
86
+
87
+ available[name] = full_path
88
+ end
90
89
  end
91
90
 
92
91
  def available
@@ -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.0".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.0
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-02-09 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.25.0
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.25.0
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.