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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51460501eac978ca4b5296191b28b820e3d61092465af21df9427c2f8c1c8586
4
- data.tar.gz: 61f8e21adfaad80e0698a5c3a609041aa95c4ce605c99878f15a187f14c049b0
3
+ metadata.gz: c94277634cce4170817b717f3ff6b3cb99ac980908f51ed6aaa6ba07a8c59de6
4
+ data.tar.gz: 4d882034612ac608246ea1a3f232a5f491c283d97b6082a97115f60f0b80fdf5
5
5
  SHA512:
6
- metadata.gz: fc97c65d39676d6613aa9878e80cb84f3ac9ec946042fd69dd164ca2c6ed558ee948757bcff8e0a71a401fe379391dc801d0cf85c0201615d036089ce37c4423
7
- data.tar.gz: 0adcea8c4075c11a507a1efb8bc7d74a2ef670b76cf8b20578d04cb44de69a1009de69f75d896978a631347f43c65ac3528065c9419bc1be51df555e0dcdef7b
6
+ metadata.gz: f8cfaf0827068925802b90582a3c12a2513649db82b23e51509ed689c111cfcbcd7397c2c260d13934dadfe3a2899481925875faf0bc75f3262c326fa8718e63
7
+ data.tar.gz: 38727869b8f7ebf8283354a7c696aded643a5da8260bce61d2ddacb4e6e441868d72eed7c01766b9e8d83d2d95954b1fab2fd75e8cdd1bf7adfabef3d23e4ae5
@@ -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
- def force_flush(timeout: nil)
13
- deadline = Deadline.new(timeout)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Flare
4
- VERSION = "0.4.1"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker