skylight 5.1.1 → 5.3.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 +4 -4
- data/CHANGELOG.md +15 -0
- data/ERRORS.md +3 -0
- data/ext/extconf.rb +16 -0
- 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/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/middleware.rb +2 -2
- data/lib/skylight/probes/rack_builder.rb +37 -0
- data/lib/skylight/probes/sinatra_add_middleware.rb +2 -2
- data/lib/skylight/railtie.rb +11 -3
- data/lib/skylight/sinatra.rb +1 -1
- data/lib/skylight/subscriber.rb +24 -2
- data/lib/skylight/test.rb +1 -5
- data/lib/skylight/util/clock.rb +1 -1
- data/lib/skylight/util/deploy.rb +4 -4
- data/lib/skylight/util/platform.rb +2 -2
- data/lib/skylight/version.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab247cb921b7d63dec0fc2fd7c6987a862986953f06765ae3472f59fb3c5ccbd
|
4
|
+
data.tar.gz: da9348e64a843ee5547808ead23c14b904d61c18431eebbf60e8aa36f41db2ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db622c8b9bcada4c1806d4891632587510e4ee06bee1ddc265d29bbf816aef404e403a8b5e1aa584342f1867089aba945de6de3dd3d8c13d38c97e3fce526be9
|
7
|
+
data.tar.gz: 79445c8d91cda531854c1e7ae9799be4b78e921fe7c4588a1bc4e1c5292546d34ac237c35d973759e9a6bc071bbe7fcd567079c71d8c462d76e93ba0becdf684
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## 5.3.0 (February, 9, 2022)
|
2
|
+
|
3
|
+
- [FEATURE] Support for Rails 7's `load_async`.
|
4
|
+
- [IMPROVEMENT] `skylight doctor` now checks glibc compatibility.
|
5
|
+
- [BUGFIX] Fix an issue where `skylight doctor` wouldn't correctly log installation errors.
|
6
|
+
|
7
|
+
## 5.2.0 (February 3, 2022)
|
8
|
+
|
9
|
+
- [FEATURE] Experimental gRPC transport
|
10
|
+
- [IMPROVEMENT] Internal native client refactors
|
11
|
+
- [IMPROVEMENT] Add Rack::Builder probe to better instrument middlewares in Sinatra and other Builder-based apps
|
12
|
+
- [BUGFIX] Fix some internal errors related to Rails 7
|
13
|
+
- [BUGFIX] Fix an issue in which trace logging could output the incorrect request ID.
|
14
|
+
- [BUGFIX] Fix native extension configuration for arm64 hosts
|
15
|
+
|
1
16
|
## 5.1.1 (May 27, 2021)
|
2
17
|
|
3
18
|
- [BUGFIX] Correct ruby version requirement in skylight.gemspec
|
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)
|
data/ext/libskylight.yml
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
|
2
|
-
---
|
3
|
-
version: "5.1.0-0d59831"
|
1
|
+
version: "5.1.0-6812c12"
|
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: "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"
|
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?
|