skylight-core 4.2.0.beta2 → 4.2.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/skylight/core/instrumentable.rb +14 -0
- data/lib/skylight/core/instrumenter.rb +15 -3
- data/lib/skylight/core/sidekiq.rb +5 -0
- data/lib/skylight/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60447468569409892f992529357071ffbc96fdec761b360f0d875dd28a4b4cda
|
4
|
+
data.tar.gz: 55f68601c0449764eea3f85a5228a233d55829f9c485500fc518a39e4465d1a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf727015e1cb1112fa8edb96ddb1845f023e15f5c15811849106fb0e8649565b69b5559037e423d446eb87d2dc533ff710cad3e0f64b603b2c892c3b377538c1
|
7
|
+
data.tar.gz: 397ab6335dcda160000b90fae373cb20731b96bd6f5f451f30e1daa037c98d38162530b71af10c892ab6bae252bd230f679d2be43af218ce3482d666c9eab200
|
@@ -98,6 +98,12 @@ module Skylight
|
|
98
98
|
return
|
99
99
|
end
|
100
100
|
|
101
|
+
if instrumenter.poisoned?
|
102
|
+
spawn_shutdown_thread!
|
103
|
+
return yield if block_given?
|
104
|
+
return
|
105
|
+
end
|
106
|
+
|
101
107
|
cat ||= DEFAULT_CATEGORY
|
102
108
|
|
103
109
|
if block_given?
|
@@ -188,6 +194,14 @@ module Skylight
|
|
188
194
|
return unless instrumenter
|
189
195
|
instrumenter.config
|
190
196
|
end
|
197
|
+
|
198
|
+
# Runs the shutdown procedure in the background.
|
199
|
+
# This should do little more than unsubscribe from all ActiveSupport::Notifications
|
200
|
+
def spawn_shutdown_thread!
|
201
|
+
@shutdown_thread || const_get(:LOCK).synchronize do
|
202
|
+
@shutdown_thread ||= Thread.new { @instrumenter&.shutdown }
|
203
|
+
end
|
204
|
+
end
|
191
205
|
end
|
192
206
|
end
|
193
207
|
end
|
@@ -260,6 +260,14 @@ module Skylight::Core
|
|
260
260
|
trace.broken!
|
261
261
|
end
|
262
262
|
|
263
|
+
def poison!
|
264
|
+
@poisoned = true
|
265
|
+
end
|
266
|
+
|
267
|
+
def poisoned?
|
268
|
+
@poisoned
|
269
|
+
end
|
270
|
+
|
263
271
|
def done(span, meta = nil)
|
264
272
|
return unless (trace = @trace_info.current)
|
265
273
|
trace.done(span, meta)
|
@@ -290,12 +298,16 @@ module Skylight::Core
|
|
290
298
|
native_submit_trace(trace)
|
291
299
|
true
|
292
300
|
rescue => e
|
293
|
-
|
294
|
-
t { "BACKTRACE:\n#{e.backtrace.join("\n")}" }
|
295
|
-
false
|
301
|
+
handle_instrumenter_error(trace, e)
|
296
302
|
end
|
297
303
|
end
|
298
304
|
|
305
|
+
def handle_instrumenter_error(trace, e)
|
306
|
+
warn "failed to submit trace to worker; trace=%s, err=%s", trace.uuid, e
|
307
|
+
t { "BACKTRACE:\n#{e.backtrace.join("\n")}" }
|
308
|
+
false
|
309
|
+
end
|
310
|
+
|
299
311
|
def ignore?(trace)
|
300
312
|
config.ignored_endpoints.include?(trace.endpoint)
|
301
313
|
end
|
@@ -2,6 +2,11 @@ module Skylight
|
|
2
2
|
module Core
|
3
3
|
module Sidekiq
|
4
4
|
def self.add_middleware(instrumentable)
|
5
|
+
unless defined?(::Sidekiq)
|
6
|
+
instrumentable.warn "Skylight for Sidekiq is active, but Sidekiq is not defined."
|
7
|
+
return
|
8
|
+
end
|
9
|
+
|
5
10
|
::Sidekiq.configure_server do |sidekiq_config|
|
6
11
|
instrumentable.debug "Adding Sidekiq Middleware"
|
7
12
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skylight-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.0.
|
4
|
+
version: 4.2.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tilde, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09
|
11
|
+
date: 2019-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|