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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! The fleet-wide diagnostics-directive store seam (`docs/05` §3-4).
//!
//! The signed `X-Debug-Directive` header is *surgical*, one request, one
//! instance. The store is its *fleet-wide* counterpart: a controller publishes a
//! [`DirectiveSet`] and every proxy instance reads it, so an operator can raise
//! verbosity across the fleet (a tenant, an endpoint, a sampled slice) without a
//! restart. Like the migration control plane (`osproxy-control`), the proxy ships
//! the **seam plus an in-process reference**, not a distributed store: a real
//! etcd/Consul/OpenSearch-index backend implements the same trait unchanged.
//!
//! Reads are **fresh per request** and on the hot path, so [`DirectiveStore::load`]
//! is a cheap `Arc` clone of the current snapshot, a distributed backend keeps a
//! watched local copy and returns it here rather than doing I/O per call. TTL
//! safety is intrinsic: directives carry an absolute expiry, so even a published
//! set that is never replaced self-expires at evaluation time.
use Arc;
use ArcSwap;
use crateDirectiveSet;
/// The backend holding the fleet's active diagnostics directives. Proxy instances
/// poll it fresh per request; a controller publishes new sets into it.
/// A fixed set: the directives never change for this process. The default store,
/// and the wrapper for a statically configured [`DirectiveSet`].
/// The in-process reference store: a controller (or an admin endpoint) `publish`es
/// a new set and proxy threads `load` it. Swappable for a distributed
/// `DirectiveStore` without touching the pipeline (`docs/05` §3).