flare 0.4.1 → 0.4.2
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/lib/flare/lifecycle.rb +8 -4
- data/lib/flare/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c94277634cce4170817b717f3ff6b3cb99ac980908f51ed6aaa6ba07a8c59de6
|
|
4
|
+
data.tar.gz: 4d882034612ac608246ea1a3f232a5f491c283d97b6082a97115f60f0b80fdf5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f8cfaf0827068925802b90582a3c12a2513649db82b23e51509ed689c111cfcbcd7397c2c260d13934dadfe3a2899481925875faf0bc75f3262c326fa8718e63
|
|
7
|
+
data.tar.gz: 38727869b8f7ebf8283354a7c696aded643a5da8260bce61d2ddacb4e6e441868d72eed7c01766b9e8d83d2d95954b1fab2fd75e8cdd1bf7adfabef3d23e4ae5
|
data/lib/flare/lifecycle.rb
CHANGED
|
@@ -6,11 +6,14 @@ require_relative "deadline"
|
|
|
6
6
|
|
|
7
7
|
module Flare
|
|
8
8
|
module Lifecycle
|
|
9
|
+
FLUSH_TIMEOUT = 5 # seconds, total across traces and metrics
|
|
10
|
+
|
|
9
11
|
# Flush all trace processors and the separate aggregated metric pipeline
|
|
10
12
|
# using one monotonic timeout budget. This is safe to call from lifecycle
|
|
11
|
-
# hooks for short-lived and fork-per-job workers.
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
# hooks for short-lived and fork-per-job workers. A nil timeout means the
|
|
14
|
+
# default, not unbounded: a hung endpoint must not stall the worker.
|
|
15
|
+
def force_flush(timeout: FLUSH_TIMEOUT)
|
|
16
|
+
deadline = Deadline.new(timeout || FLUSH_TIMEOUT)
|
|
14
17
|
results = []
|
|
15
18
|
|
|
16
19
|
results << tracer_provider_for_flush.force_flush(timeout: deadline.remaining)
|
|
@@ -34,8 +37,9 @@ module Flare
|
|
|
34
37
|
# finish well before the platform's kill deadline even if endpoints hang.
|
|
35
38
|
# Metrics (a minute of aggregated counts) get first claim on the time;
|
|
36
39
|
# span/trace processors get what's left, capped at TRACE_SHUTDOWN_TIMEOUT.
|
|
40
|
+
# A nil timeout means the default, not unbounded: shutdown is always bounded.
|
|
37
41
|
def shutdown(timeout: SHUTDOWN_TIMEOUT)
|
|
38
|
-
deadline = Deadline.new(timeout)
|
|
42
|
+
deadline = Deadline.new(timeout || SHUTDOWN_TIMEOUT)
|
|
39
43
|
|
|
40
44
|
shutdown_step("rule manager") { @rule_manager&.stop(timeout: 0) }
|
|
41
45
|
shutdown_step("metrics") { @metric_flusher&.stop(timeout: [deadline.remaining - TRACE_SHUTDOWN_TIMEOUT, 0].max) }
|
data/lib/flare/version.rb
CHANGED