skylight 5.3.2 → 5.3.4
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 +4 -4
- data/CHANGELOG.md +11 -0
- data/ext/extconf.rb +8 -8
- data/lib/skylight/middleware.rb +1 -1
- data/lib/skylight/native.rb +3 -3
- data/lib/skylight/probes/mongo.rb +14 -1
- data/lib/skylight/probes/mongoid.rb +6 -13
- data/lib/skylight/probes/redis.rb +18 -1
- data/lib/skylight/railtie.rb +1 -1
- data/lib/skylight/sidekiq.rb +1 -1
- data/lib/skylight/user_config.rb +4 -2
- data/lib/skylight/util/platform.rb +1 -1
- data/lib/skylight/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eff8fe1dc5d710696a97b5e2a3cfe53eba04e34a9ded8c9b550bc82538b6dfbb
|
4
|
+
data.tar.gz: a1236552d1cee17eaf0c0aee7371e7f6f201ab6810c4721a7ac67dcfe1f70177
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a91c535de86e475c325c9a287c92754603e186e583691f4db240557a1d3fc9393ea0180c0e18273e86350c16562097b6040d709f91692340788b13c605a858
|
7
|
+
data.tar.gz: c0bbf8d365bf386a7e1a0ae858b8007cb4046416e91b69862b250c21938a72b725ad0b0f5f0d25ffc73fc4fb435dff705bcb50c00c416fcdf0bb58e9dbcf8cfc
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 5.3.4 (October 17, 2022)
|
2
|
+
|
3
|
+
- [BUGFIX] Fix a middleware response method that was incompatible with Puma >= 6.
|
4
|
+
- [IMPROVEMENT] Improved support for Redis v5
|
5
|
+
|
6
|
+
## 5.3.3 (July 13, 2022)
|
7
|
+
|
8
|
+
- [IMPROVEMENT] Track the original class/method name for Sidekiq delayed object proxies
|
9
|
+
- [BUGFIX] Fix `mongoid` probe not activating correctly
|
10
|
+
- [BUGFIX] Fix `mongo` probe not instrumenting clients created before Skylight initialization
|
11
|
+
|
1
12
|
## 5.3.2 (April 6, 2022)
|
2
13
|
|
3
14
|
- [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
|
47
|
-
SKYLIGHT_FETCH_LIB = !ENV.key?("SKYLIGHT_FETCH_LIB") || ENV
|
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
|
50
|
+
SKYLIGHT_HDR_PATH = ENV.fetch("SKYLIGHT_HDR_PATH") { ENV.fetch("SKYLIGHT_LIB_PATH", ".") }
|
51
51
|
SKYLIGHT_LIB_PATH =
|
52
|
-
ENV
|
52
|
+
ENV.fetch("SKYLIGHT_LIB_PATH") { File.expand_path("../../lib/skylight/native/#{Platform.tuple}", __FILE__) }
|
53
53
|
|
54
|
-
SKYLIGHT_SOURCE_URL = ENV
|
55
|
-
SKYLIGHT_VERSION = ENV
|
56
|
-
SKYLIGHT_CHECKSUM = ENV
|
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
|
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/lib/skylight/middleware.rb
CHANGED
data/lib/skylight/native.rb
CHANGED
@@ -59,13 +59,13 @@ module Skylight
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def self.libskylight_path
|
62
|
-
ENV
|
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
|
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
|
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
|
-
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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"
|
@@ -20,6 +20,18 @@ module Skylight
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
+
module ClientInstrumentationV5
|
24
|
+
def call_v(command)
|
25
|
+
command_name = command[0]
|
26
|
+
|
27
|
+
return super if command_name == :auth
|
28
|
+
|
29
|
+
opts = { category: "db.redis.command", title: command_name.upcase.to_s, internal: true }
|
30
|
+
|
31
|
+
Skylight.instrument(opts) { super }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
23
35
|
module Instrumentation
|
24
36
|
def pipelined(*)
|
25
37
|
Skylight.instrument(PIPELINED_OPTS) { super }
|
@@ -40,7 +52,12 @@ module Skylight
|
|
40
52
|
return
|
41
53
|
end
|
42
54
|
|
43
|
-
::Redis::Client.
|
55
|
+
if ::Redis::Client.method_defined?(:call_v)
|
56
|
+
::Redis::Client.prepend(ClientInstrumentationV5)
|
57
|
+
else
|
58
|
+
::Redis::Client.prepend(ClientInstrumentation)
|
59
|
+
end
|
60
|
+
|
44
61
|
::Redis.prepend(Instrumentation)
|
45
62
|
end
|
46
63
|
end
|
data/lib/skylight/railtie.rb
CHANGED
@@ -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
|
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
|
|
data/lib/skylight/sidekiq.rb
CHANGED
@@ -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 =
|
data/lib/skylight/user_config.rb
CHANGED
@@ -18,7 +18,9 @@ module Skylight
|
|
18
18
|
@config[:user_config_path] ||
|
19
19
|
begin
|
20
20
|
require "etc"
|
21
|
-
home_dir =
|
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
|
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
|
15
|
+
ENV.fetch("SKYLIGHT_MUSL") { `ldd --version 2>&1` =~ /musl/ } ? "linux-musl" : "linux"
|
16
16
|
when /darwin/
|
17
17
|
"darwin"
|
18
18
|
when /freebsd/
|
data/lib/skylight/version.rb
CHANGED
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.
|
4
|
+
version: 5.3.4
|
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-
|
11
|
+
date: 2022-10-17 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.
|
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.
|
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.
|
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.
|
152
|
+
version: 1.31.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: simplecov
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|