1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! The diagnostic-capture sink: where directive-selected explanations go *off the
//! instance* (`docs/05` ยง5).
//!
//! A proxy fleet serves a request on whichever instance the load balancer picked,
//! so a captured `/debug/explain` document lands on *that* instance, its local
//! break-glass ring and `/debug/explain` store are invisible to the others. To
//! diagnose "why did request X route there" across a fleet, the capture must leave
//! the instance, keyed by `trace_id` (which the explain doc already carries), so an
//! external aggregator holds the whole fleet's record under one key.
//!
//! This seam is the **fleet-coherent counterpart of the break-glass ring**: the
//! same `ring_buffer`/`capture` directive that fills the local tape also hands the
//! shape-only explain doc to a [`DiagnosticSink`]. It is distinct from the
//! per-request request-log (all-or-none), it pushes only the *directive-selected*
//! captures. The doc is shape-only by construction (it is the explain doc), so the
//! sink never carries a tenant value.
use Value;
/// Receives directive-selected diagnostic documents (each a `/debug/explain` doc)
/// for delivery to a fleet-wide store/aggregator, keyed by the `trace_id` the doc
/// carries.
///
/// Implementations MUST NOT block: `emit` is called inline on the request path
/// (only for captured requests), so any network I/O belongs in a spawned task.
/// They MUST NOT panic. Delivery is best-effort, a slow or down sink must never
/// affect the request.
/// The default sink: off-instance emission is disabled, so a directive-selected
/// capture stays in the local break-glass ring only (single-instance).
;