skylight 5.1.1 → 5.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -1
- data/ERRORS.md +3 -0
- data/ext/extconf.rb +24 -8
- data/ext/libskylight.yml +8 -10
- data/ext/skylight_native.c +2 -0
- data/lib/skylight/cli/doctor.rb +2 -2
- data/lib/skylight/config.rb +42 -38
- data/lib/skylight/data/cacert.pem +730 -1023
- data/lib/skylight/errors.rb +3 -0
- data/lib/skylight/extensions/source_location.rb +2 -2
- data/lib/skylight/instrumenter.rb +1 -1
- data/lib/skylight/middleware.rb +16 -3
- data/lib/skylight/native.rb +3 -3
- data/lib/skylight/normalizers/active_job/perform.rb +22 -25
- data/lib/skylight/normalizers/active_record/sql.rb +8 -0
- data/lib/skylight/normalizers/grape/endpoint.rb +1 -1
- data/lib/skylight/normalizers/sql.rb +5 -9
- data/lib/skylight/probes/active_record_async.rb +96 -0
- data/lib/skylight/probes/elasticsearch.rb +10 -1
- data/lib/skylight/probes/middleware.rb +2 -2
- data/lib/skylight/probes/mongo.rb +14 -1
- data/lib/skylight/probes/mongoid.rb +6 -13
- data/lib/skylight/probes/rack_builder.rb +37 -0
- data/lib/skylight/probes/sinatra_add_middleware.rb +2 -2
- data/lib/skylight/probes.rb +8 -9
- data/lib/skylight/railtie.rb +12 -4
- data/lib/skylight/sidekiq.rb +1 -1
- data/lib/skylight/sinatra.rb +1 -1
- data/lib/skylight/subscriber.rb +24 -2
- data/lib/skylight/test.rb +1 -5
- data/lib/skylight/user_config.rb +4 -2
- data/lib/skylight/util/clock.rb +1 -1
- data/lib/skylight/util/deploy.rb +4 -4
- data/lib/skylight/util/platform.rb +3 -3
- data/lib/skylight/version.rb +1 -1
- metadata +10 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3b769eb5f54b2400e4e2ba1678a5e45e1bdf3aff9dc205274387317035e606b
|
4
|
+
data.tar.gz: 1bf4191e377224dfb2c5e064dc6391462c2005a6bf3c8cc658feaa6b6d67e002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 830f58c5a32ffaf48584fe0769508451e2b0719fb0fc3ed9c3c13a031fff5706e94485a9bf11dacbf0c9b48e95cfd4df07d875eb097c54e90fcf018858eca133
|
7
|
+
data.tar.gz: 1bcdb766cbb4040a9f0734ebeb2a727ddc665bef8c58842b69a48dc33a965b0985ae4dd38cea714f2acca4ab12b79a55c37b5c1bba43985541c68ff80687d7f9
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,37 @@
|
|
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)
|
16
|
+
|
17
|
+
- [FEATURE] Support for Rails 7's `load_async`.
|
18
|
+
- [IMPROVEMENT] `skylight doctor` now checks glibc compatibility.
|
19
|
+
- [BUGFIX] Fix an issue where `skylight doctor` wouldn't correctly log installation errors.
|
20
|
+
|
21
|
+
## 5.2.0 (February 3, 2022)
|
22
|
+
|
23
|
+
- [FEATURE] Experimental gRPC transport
|
24
|
+
- [IMPROVEMENT] Internal native client refactors
|
25
|
+
- [IMPROVEMENT] Add Rack::Builder probe to better instrument middlewares in Sinatra and other Builder-based apps
|
26
|
+
- [BUGFIX] Fix some internal errors related to Rails 7
|
27
|
+
- [BUGFIX] Fix an issue in which trace logging could output the incorrect request ID.
|
28
|
+
- [BUGFIX] Fix native extension configuration for arm64 hosts
|
29
|
+
|
1
30
|
## 5.1.1 (May 27, 2021)
|
2
31
|
|
3
32
|
- [BUGFIX] Correct ruby version requirement in skylight.gemspec
|
4
33
|
|
5
|
-
## 5.1.0 (May 24, 2021)
|
34
|
+
## 5.1.0 (May 24, 2021) [YANKED]
|
6
35
|
|
7
36
|
- [FEATURE] Add experimental tcp-based `skylightd` (may be enabled with `SKYLIGHT_ENABLE_TCP=true`)
|
8
37
|
|
data/ERRORS.md
CHANGED
@@ -2,4 +2,7 @@ E0001 - Spans were closed out of order
|
|
2
2
|
E0002 - Exceeded the number of unique span descriptions
|
3
3
|
E0003 - Exceeded maximum number of spans
|
4
4
|
E0004 - Failed to lex SQL query
|
5
|
+
E0005 - Instrumenter is not running
|
6
|
+
E0006 - Invalid UTF-8
|
7
|
+
E0007 - Failed to connect to gRPC server
|
5
8
|
E9999 - Unknown
|
data/ext/extconf.rb
CHANGED
@@ -9,6 +9,22 @@ $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
|
|
9
9
|
require "skylight/native_ext_fetcher"
|
10
10
|
require "skylight/util/platform"
|
11
11
|
|
12
|
+
GLIBC_MIN = 2.23
|
13
|
+
GLIBC_V4_MIN = 2.15
|
14
|
+
|
15
|
+
ldd_output =
|
16
|
+
begin
|
17
|
+
`ldd --version`
|
18
|
+
rescue Errno::ENOENT
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
|
22
|
+
if ldd_output =~ /GLIBC (\d+(\.\d+)+)/ && ($1.to_f < GLIBC_MIN)
|
23
|
+
message = "glibc #{GLIBC_MIN}+ is required but you have #{$1} installed."
|
24
|
+
message << "\nYou may be able to use Skylight v4 instead." if $1.to_f >= GLIBC_V4_MIN
|
25
|
+
fail message
|
26
|
+
end
|
27
|
+
|
12
28
|
# Util allowing proxying writes to multiple location
|
13
29
|
class MultiIO
|
14
30
|
def initialize(*targets)
|
@@ -27,19 +43,19 @@ end
|
|
27
43
|
include Skylight::Util
|
28
44
|
|
29
45
|
SKYLIGHT_INSTALL_LOG = File.expand_path("install.log", __dir__)
|
30
|
-
SKYLIGHT_REQUIRED = ENV.key?("SKYLIGHT_REQUIRED") && ENV
|
31
|
-
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
|
32
48
|
|
33
49
|
# Directory where skylight.h exists
|
34
|
-
SKYLIGHT_HDR_PATH = ENV
|
50
|
+
SKYLIGHT_HDR_PATH = ENV.fetch("SKYLIGHT_HDR_PATH") { ENV.fetch("SKYLIGHT_LIB_PATH", ".") }
|
35
51
|
SKYLIGHT_LIB_PATH =
|
36
|
-
ENV
|
52
|
+
ENV.fetch("SKYLIGHT_LIB_PATH") { File.expand_path("../../lib/skylight/native/#{Platform.tuple}", __FILE__) }
|
37
53
|
|
38
|
-
SKYLIGHT_SOURCE_URL = ENV
|
39
|
-
SKYLIGHT_VERSION = ENV
|
40
|
-
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)
|
41
57
|
|
42
|
-
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
|
43
59
|
|
44
60
|
# Setup logger
|
45
61
|
LOG = Logger.new(MultiIO.new($stdout, File.open(SKYLIGHT_INSTALL_LOG, "a")))
|
data/ext/libskylight.yml
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
|
2
|
-
---
|
3
|
-
version: "5.1.0-0d59831"
|
1
|
+
version: "5.1.0-cd7d6af"
|
4
2
|
checksums:
|
5
|
-
x86-linux: "
|
6
|
-
x86_64-linux: "
|
7
|
-
x86_64-linux-musl: "
|
8
|
-
x86_64-darwin: "
|
9
|
-
aarch64-linux: "
|
10
|
-
aarch64-linux-musl: "
|
11
|
-
aarch64-darwin: "
|
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"
|
data/ext/skylight_native.c
CHANGED
@@ -520,6 +520,7 @@ void Init_skylight_native() {
|
|
520
520
|
|
521
521
|
rb_cTrace = rb_const_get(rb_mSkylight, rb_intern("Trace"));
|
522
522
|
rb_define_singleton_method(rb_cTrace, "native_new", trace_new, 4);
|
523
|
+
rb_undef_alloc_func(rb_cTrace);
|
523
524
|
rb_define_method(rb_cTrace, "native_get_started_at", trace_get_started_at, 0);
|
524
525
|
rb_define_method(rb_cTrace, "native_get_endpoint", trace_get_endpoint, 0);
|
525
526
|
rb_define_method(rb_cTrace, "native_set_endpoint", trace_set_endpoint, 1);
|
@@ -540,6 +541,7 @@ void Init_skylight_native() {
|
|
540
541
|
|
541
542
|
rb_cInstrumenter = rb_const_get(rb_mSkylight, rb_intern("Instrumenter"));
|
542
543
|
rb_define_singleton_method(rb_cInstrumenter, "native_new", instrumenter_new, 2);
|
544
|
+
rb_undef_alloc_func(rb_cInstrumenter);
|
543
545
|
rb_define_method(rb_cInstrumenter, "native_start", instrumenter_start, 0);
|
544
546
|
rb_define_method(rb_cInstrumenter, "native_stop", instrumenter_stop, 0);
|
545
547
|
rb_define_method(rb_cInstrumenter, "native_submit_trace", instrumenter_submit_trace, 1);
|
data/lib/skylight/cli/doctor.rb
CHANGED
@@ -65,7 +65,7 @@ module Skylight
|
|
65
65
|
say "Unable to load native extension", :yellow
|
66
66
|
|
67
67
|
indent do
|
68
|
-
install_log = File.expand_path("
|
68
|
+
install_log = File.expand_path("../../../ext/install.log", __dir__)
|
69
69
|
if File.exist?(install_log)
|
70
70
|
File.readlines(install_log).each { |line| say line, :red }
|
71
71
|
else
|
@@ -119,7 +119,7 @@ module Skylight
|
|
119
119
|
end
|
120
120
|
config.logger = logger
|
121
121
|
|
122
|
-
config.set(:
|
122
|
+
config.set(:"daemon.lazy_start", false)
|
123
123
|
|
124
124
|
started = Skylight.start!(config)
|
125
125
|
|
data/lib/skylight/config.rb
CHANGED
@@ -32,9 +32,9 @@ module Skylight
|
|
32
32
|
-"COMPONENT" => :component,
|
33
33
|
-"REPORT_RAILS_ENV" => :report_rails_env,
|
34
34
|
# == Deploy settings ==
|
35
|
-
-"DEPLOY_ID" => :
|
36
|
-
-"DEPLOY_GIT_SHA" => :
|
37
|
-
-"DEPLOY_DESCRIPTION" => :
|
35
|
+
-"DEPLOY_ID" => :"deploy.id",
|
36
|
+
-"DEPLOY_GIT_SHA" => :"deploy.git_sha",
|
37
|
+
-"DEPLOY_DESCRIPTION" => :"deploy.description",
|
38
38
|
# == Logging ==
|
39
39
|
-"LOG_FILE" => :log_file,
|
40
40
|
-"LOG_LEVEL" => :log_level,
|
@@ -67,37 +67,39 @@ module Skylight
|
|
67
67
|
-"REPORT_HTTP_CONNECT_TIMEOUT" => :report_http_connect_timeout,
|
68
68
|
-"REPORT_HTTP_READ_TIMEOUT" => :report_http_read_timeout,
|
69
69
|
-"REPORT_HTTP_DISABLED" => :report_http_disabled,
|
70
|
+
-"REPORT_USE_GRPC" => :report_use_grpc,
|
71
|
+
-"REPORT_GRPC_URL" => :report_grpc_url,
|
70
72
|
# == Native agent settings ==
|
71
73
|
#
|
72
|
-
-"LAZY_START" => :
|
73
|
-
-"DAEMON_EXEC_PATH" => :
|
74
|
-
-"DAEMON_LIB_PATH" => :
|
75
|
-
-"PIDFILE_PATH" => :
|
76
|
-
-"SOCKDIR_PATH" => :
|
77
|
-
-"BATCH_QUEUE_DEPTH" => :
|
78
|
-
-"BATCH_SAMPLE_SIZE" => :
|
79
|
-
-"BATCH_FLUSH_INTERVAL" => :
|
80
|
-
-"DAEMON_TICK_INTERVAL" => :
|
81
|
-
-"DAEMON_LOCK_CHECK_INTERVAL" => :
|
82
|
-
-"DAEMON_INACTIVITY_TIMEOUT" => :
|
83
|
-
-"CLIENT_MAX_TRIES" => :
|
84
|
-
-"CLIENT_CONN_TRY_WIN" => :
|
85
|
-
-"MAX_PRESPAWN_JITTER" => :
|
86
|
-
-"DAEMON_WAIT_TIMEOUT" => :
|
87
|
-
-"CLIENT_CHECK_INTERVAL" => :
|
88
|
-
-"CLIENT_QUEUE_DEPTH" => :
|
89
|
-
-"CLIENT_WRITE_TIMEOUT" => :
|
90
|
-
-"SSL_CERT_PATH" => :
|
91
|
-
-"ENABLE_TCP" => :
|
92
|
-
-"TCP_PORT" => :
|
74
|
+
-"LAZY_START" => :"daemon.lazy_start",
|
75
|
+
-"DAEMON_EXEC_PATH" => :"daemon.exec_path",
|
76
|
+
-"DAEMON_LIB_PATH" => :"daemon.lib_path",
|
77
|
+
-"PIDFILE_PATH" => :"daemon.pidfile_path",
|
78
|
+
-"SOCKDIR_PATH" => :"daemon.sockdir_path",
|
79
|
+
-"BATCH_QUEUE_DEPTH" => :"daemon.batch_queue_depth",
|
80
|
+
-"BATCH_SAMPLE_SIZE" => :"daemon.batch_sample_size",
|
81
|
+
-"BATCH_FLUSH_INTERVAL" => :"daemon.batch_flush_interval",
|
82
|
+
-"DAEMON_TICK_INTERVAL" => :"daemon.tick_interval",
|
83
|
+
-"DAEMON_LOCK_CHECK_INTERVAL" => :"daemon.lock_check_interval",
|
84
|
+
-"DAEMON_INACTIVITY_TIMEOUT" => :"daemon.inactivity_timeout",
|
85
|
+
-"CLIENT_MAX_TRIES" => :"daemon.max_connect_tries",
|
86
|
+
-"CLIENT_CONN_TRY_WIN" => :"daemon.connect_try_window",
|
87
|
+
-"MAX_PRESPAWN_JITTER" => :"daemon.max_prespawn_jitter",
|
88
|
+
-"DAEMON_WAIT_TIMEOUT" => :"daemon.wait_timeout",
|
89
|
+
-"CLIENT_CHECK_INTERVAL" => :"daemon.client_check_interval",
|
90
|
+
-"CLIENT_QUEUE_DEPTH" => :"daemon.client_queue_depth",
|
91
|
+
-"CLIENT_WRITE_TIMEOUT" => :"daemon.client_write_timeout",
|
92
|
+
-"SSL_CERT_PATH" => :"daemon.ssl_cert_path",
|
93
|
+
-"ENABLE_TCP" => :"daemon.enable_tcp",
|
94
|
+
-"TCP_PORT" => :"daemon.tcp_port",
|
93
95
|
# == Legacy env vars ==
|
94
96
|
#
|
95
|
-
-"AGENT_LOCKFILE" => :
|
96
|
-
-"AGENT_SOCKFILE_PATH" => :
|
97
|
+
-"AGENT_LOCKFILE" => :"agent.lockfile",
|
98
|
+
-"AGENT_SOCKFILE_PATH" => :"agent.sockfile_path",
|
97
99
|
# == User config settings ==
|
98
100
|
-"USER_CONFIG_PATH" => :user_config_path,
|
99
101
|
# == Heroku settings ==
|
100
|
-
-"HEROKU_DYNO_INFO_PATH" => :
|
102
|
+
-"HEROKU_DYNO_INFO_PATH" => :"heroku.dyno_info_path",
|
101
103
|
# == Source Location ==
|
102
104
|
-"SOURCE_LOCATION_IGNORED_GEMS" => :source_location_ignored_gems,
|
103
105
|
-"SOURCE_LOCATION_CACHE_SIZE" => :source_location_cache_size
|
@@ -135,22 +137,22 @@ module Skylight
|
|
135
137
|
sinatra_route_prefixes: false,
|
136
138
|
enable_source_locations: true,
|
137
139
|
# Deploys
|
138
|
-
|
140
|
+
"heroku.dyno_info_path": -"/etc/heroku/dyno",
|
139
141
|
report_rails_env: true,
|
140
142
|
# Daemon
|
141
|
-
|
143
|
+
"daemon.lazy_start": true,
|
142
144
|
hostname: Util::Hostname.default_hostname,
|
143
145
|
report_max_spans_exceeded: false,
|
144
146
|
prune_large_traces: true
|
145
147
|
}
|
146
148
|
|
147
|
-
ret[:
|
149
|
+
ret[:"daemon.ssl_cert_path"] = Util::SSL.ca_cert_file_or_default unless Util::Platform::OS == -"darwin"
|
148
150
|
|
149
151
|
if Skylight.native?
|
150
152
|
native_path = Skylight.libskylight_path
|
151
153
|
|
152
|
-
ret[:
|
153
|
-
ret[:
|
154
|
+
ret[:"daemon.lib_path"] = native_path
|
155
|
+
ret[:"daemon.exec_path"] = File.join(native_path, "skylightd")
|
154
156
|
end
|
155
157
|
|
156
158
|
ret
|
@@ -184,6 +186,8 @@ module Skylight
|
|
184
186
|
report_http_connect_timeout
|
185
187
|
report_http_read_timeout
|
186
188
|
report_http_disabled
|
189
|
+
report_use_grpc
|
190
|
+
report_grpc_url
|
187
191
|
daemon.lazy_start
|
188
192
|
daemon.exec_path
|
189
193
|
daemon.lib_path
|
@@ -211,12 +215,12 @@ module Skylight
|
|
211
215
|
|
212
216
|
# Maps legacy config keys to new config keys
|
213
217
|
def self.legacy_keys
|
214
|
-
@legacy_keys ||= {
|
218
|
+
@legacy_keys ||= { "agent.sockfile_path": :"daemon.sockdir_path", "agent.lockfile": :"daemon.pidfile_path" }
|
215
219
|
end
|
216
220
|
|
217
221
|
def self.validators
|
218
222
|
@validators ||=
|
219
|
-
{
|
223
|
+
{ "agent.interval": [->(v, _c) { v.is_a?(Integer) && v > 0 }, "must be an integer greater than 0"] }
|
220
224
|
end
|
221
225
|
|
222
226
|
# @api private
|
@@ -334,8 +338,8 @@ module Skylight
|
|
334
338
|
# TODO: Move this out of the validate! method: https://github.com/tildeio/direwolf-agent/issues/273
|
335
339
|
# FIXME: Why not set the sockdir_path and pidfile_path explicitly?
|
336
340
|
# That way we don't have to keep this in sync with the Rust repo.
|
337
|
-
sockdir_path = File.expand_path(self[:
|
338
|
-
pidfile_path = File.expand_path(self[:
|
341
|
+
sockdir_path = File.expand_path(self[:"daemon.sockdir_path"] || ".", root)
|
342
|
+
pidfile_path = File.expand_path(self[:"daemon.pidfile_path"] || "skylight.pid", sockdir_path)
|
339
343
|
|
340
344
|
check_file_permissions(pidfile_path, "daemon.pidfile_path or daemon.sockdir_path")
|
341
345
|
check_sockdir_permissions(sockdir_path)
|
@@ -588,7 +592,7 @@ module Skylight
|
|
588
592
|
end
|
589
593
|
|
590
594
|
def on_heroku?
|
591
|
-
File.exist?(get(:
|
595
|
+
File.exist?(get(:"heroku.dyno_info_path"))
|
592
596
|
end
|
593
597
|
|
594
598
|
private
|
@@ -655,7 +659,7 @@ module Skylight
|
|
655
659
|
corrected_config = res.corrected_config
|
656
660
|
|
657
661
|
# Use defaults if no corrected config is available. This will happen if the request failed.
|
658
|
-
corrected_config ||= SERVER_VALIDATE.
|
662
|
+
corrected_config ||= SERVER_VALIDATE.to_h { |k| [k, self.class.default_values.fetch(k)] }
|
659
663
|
|
660
664
|
config_to_update = corrected_config.reject { |k, v| get(k) == v }
|
661
665
|
unless config_to_update.empty?
|