pub struct DiagnosticsDirective {
pub id: String,
pub match_: DirectiveMatch,
pub level: DiagLevel,
pub sample_per_mille: u16,
pub expires_at: Instant,
pub ring_buffer: bool,
pub capture: bool,
}Expand description
One diagnostics directive: target, verbosity, sampling, and expiry.
Fields§
§id: StringA stable id for management/correlation (never a tenant value).
match_: DirectiveMatchWhat this directive targets.
level: DiagLevelThe verbosity to apply to matching requests.
sample_per_mille: u16Fraction of matching requests to record, in 0..=1 (scaled to per-mille
so the directive stays Eq/Hash-friendly; 1000 = always).
expires_at: InstantAbsolute expiry: a request at or after this instant does not match (the TTL was applied when the directive was created).
ring_buffer: boolSingle-instance break-glass: capture into the local ring buffer.
capture: boolFleet traffic capture: tee the matching exchanges to the configured
capture sink (e.g. Kafka). The runtime on/off switch for capture, off in
the baseline, flipped on by publishing a directive, so capture is on demand
and fleet-wide with no restart. Distinct from Self::ring_buffer, which
is the single-instance forensic tape.
Implementations§
Source§impl DiagnosticsDirective
impl DiagnosticsDirective
Sourcepub fn level_if_applies(
&self,
attrs: &RequestAttrs<'_>,
now: Instant,
request: &RequestId,
) -> Option<DiagLevel>
pub fn level_if_applies( &self, attrs: &RequestAttrs<'_>, now: Instant, request: &RequestId, ) -> Option<DiagLevel>
This directive’s DiagLevel if it applies to attrs at now for
request (target matches, not expired, in sample), else None. Used to
fold a single-request (signed-header) directive into the evaluation.
Trait Implementations§
Source§impl Clone for DiagnosticsDirective
impl Clone for DiagnosticsDirective
Source§fn clone(&self) -> DiagnosticsDirective
fn clone(&self) -> DiagnosticsDirective
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DiagnosticsDirective
impl Debug for DiagnosticsDirective
impl Eq for DiagnosticsDirective
Source§impl PartialEq for DiagnosticsDirective
impl PartialEq for DiagnosticsDirective
Source§fn eq(&self, other: &DiagnosticsDirective) -> bool
fn eq(&self, other: &DiagnosticsDirective) -> bool
self and other values to be equal, and is used by ==.