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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2881749e5739ff283ad0f62f4db4c22697a6ee17a9f0f47f80839591f49e104c
4
- data.tar.gz: 8c8b28c31dc351e9a2c3e847907f90917aede27e6cef2c0881392769c9b5510d
3
+ metadata.gz: ab247cb921b7d63dec0fc2fd7c6987a862986953f06765ae3472f59fb3c5ccbd
4
+ data.tar.gz: da9348e64a843ee5547808ead23c14b904d61c18431eebbf60e8aa36f41db2ef
5
5
  SHA512:
6
- metadata.gz: ee70e27064ac11830d29ee7fdf52886a0b776afe3e36aec79e5c2da40e6a0fe09f40ff46d4e7c5947587bd94428bf3b1dd40274fdc4fdbc93836aabedf0b5f1d
7
- data.tar.gz: c3441c25d153055d0461b23c01416bf773c612c3af607dd8b9cf142491f5237b205e4da5ab1edcf653327199cdcbceba3170a4c101560dc875d991b6945a98c2
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
- # commit b6bb0714913a5be54f4eac717d5096dc7ba5f3eb
2
- ---
3
- version: "5.1.0-0d59831"
1
+ version: "5.1.0-6812c12"
4
2
  checksums:
5
- x86-linux: "e15fff9269f5451302aaee56b4d4631c86f979298bc22536f28f884c170c127f"
6
- x86_64-linux: "be95b9c91dffb0133b57183d160cad700213703a87f52488cf114a4fff92ff4d"
7
- x86_64-linux-musl: "945ebefa0384e23121bc1674f0eda0600aef204599e5819bdbecd6d62252b769"
8
- x86_64-darwin: "d98ee1d331394ac43bd37f2d3d5d591a41d912dfa2c3e5d0b21d97f7a5198cf1"
9
- aarch64-linux: "b6add5dda52a2cae4b5e3899a5e0c938049385443d82acbd1a8a2fb0d8502933"
10
- aarch64-linux-musl: "667030ade09a69a664380262ec1e6ceeb77f49585201e670528f4cd52d3def86"
11
- aarch64-darwin: "d3225034d18d99e358ace24cf951468feaf3b83f0b33e32965bc2139e0300505"
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"
@@ -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);
@@ -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("../../ext/install.log", __dir__)
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(:'daemon.lazy_start', false)
122
+ config.set(:"daemon.lazy_start", false)
123
123
 
124
124
  started = Skylight.start!(config)
125
125
 
@@ -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" => :'deploy.id',
36
- -"DEPLOY_GIT_SHA" => :'deploy.git_sha',
37
- -"DEPLOY_DESCRIPTION" => :'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" => :'daemon.lazy_start',
73
- -"DAEMON_EXEC_PATH" => :'daemon.exec_path',
74
- -"DAEMON_LIB_PATH" => :'daemon.lib_path',
75
- -"PIDFILE_PATH" => :'daemon.pidfile_path',
76
- -"SOCKDIR_PATH" => :'daemon.sockdir_path',
77
- -"BATCH_QUEUE_DEPTH" => :'daemon.batch_queue_depth',
78
- -"BATCH_SAMPLE_SIZE" => :'daemon.batch_sample_size',
79
- -"BATCH_FLUSH_INTERVAL" => :'daemon.batch_flush_interval',
80
- -"DAEMON_TICK_INTERVAL" => :'daemon.tick_interval',
81
- -"DAEMON_LOCK_CHECK_INTERVAL" => :'daemon.lock_check_interval',
82
- -"DAEMON_INACTIVITY_TIMEOUT" => :'daemon.inactivity_timeout',
83
- -"CLIENT_MAX_TRIES" => :'daemon.max_connect_tries',
84
- -"CLIENT_CONN_TRY_WIN" => :'daemon.connect_try_window',
85
- -"MAX_PRESPAWN_JITTER" => :'daemon.max_prespawn_jitter',
86
- -"DAEMON_WAIT_TIMEOUT" => :'daemon.wait_timeout',
87
- -"CLIENT_CHECK_INTERVAL" => :'daemon.client_check_interval',
88
- -"CLIENT_QUEUE_DEPTH" => :'daemon.client_queue_depth',
89
- -"CLIENT_WRITE_TIMEOUT" => :'daemon.client_write_timeout',
90
- -"SSL_CERT_PATH" => :'daemon.ssl_cert_path',
91
- -"ENABLE_TCP" => :'daemon.enable_tcp',
92
- -"TCP_PORT" => :'daemon.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" => :'agent.lockfile',
96
- -"AGENT_SOCKFILE_PATH" => :'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" => :'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
- 'heroku.dyno_info_path': -"/etc/heroku/dyno",
140
+ "heroku.dyno_info_path": -"/etc/heroku/dyno",
139
141
  report_rails_env: true,
140
142
  # Daemon
141
- 'daemon.lazy_start': true,
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[:'daemon.ssl_cert_path'] = Util::SSL.ca_cert_file_or_default unless Util::Platform::OS == -"darwin"
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[:'daemon.lib_path'] = native_path
153
- ret[:'daemon.exec_path'] = File.join(native_path, "skylightd")
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 ||= { 'agent.sockfile_path': :'daemon.sockdir_path', 'agent.lockfile': :'daemon.pidfile_path' }
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
- { 'agent.interval': [->(v, _c) { v.is_a?(Integer) && v > 0 }, "must be an integer greater than 0"] }
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[:'daemon.sockdir_path'] || ".", root)
338
- pidfile_path = File.expand_path(self[:'daemon.pidfile_path'] || "skylight.pid", sockdir_path)
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(:'heroku.dyno_info_path'))
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.map { |k| [k, self.class.default_values.fetch(k)] }.to_h
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?