#[non_exhaustive]pub struct TraceConfig {
pub capture_body: bool,
pub max_body_bytes: usize,
pub header_redaction: HeaderRedactionMode,
pub header_denylist: Vec<String>,
pub header_allowlist: Vec<String>,
}Expand description
Trace-channel behaviour configuration (RFC 023, extended by RFC 040).
Configurable today only at this Rust level — the trace channel has
no config-file or CLI surface yet (RFC 040’s own Motivation notes
this; RFC 023’s [trace] TOML section was never wired to this
struct). TraceEmitter::new() always uses TraceConfig::default().
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.capture_body: boolCapture the JSON request body in each event. Default: false.
max_body_bytes: usizeMaximum serialised body size in bytes. Bodies larger than this
are omitted and body_truncated = true is set. Default: 8 192.
header_redaction: HeaderRedactionModeDenylist or allowlist by default. Default: Denylist. Governs
headers, query-string parameters, and JSON body keys alike (RFC
073 S-05) — see DEFAULT_HEADER_DENYLIST’s doc comment.
header_denylist: Vec<String>Names redacted when header_redaction is Denylist — header
names, query-string parameter names, and JSON body object keys
alike (RFC 073 S-05). Compared case-insensitively. Default:
DEFAULT_HEADER_DENYLIST.
header_allowlist: Vec<String>Names captured when header_redaction is Allowlist; every
other name (header, query parameter, or body key) is redacted.
Compared case-insensitively. Default: empty, i.e. allowlist mode
redacts everything until configured — the safe direction for a
fail-closed mode.
Trait Implementations§
Source§impl Clone for TraceConfig
impl Clone for TraceConfig
Source§fn clone(&self) -> TraceConfig
fn clone(&self) -> TraceConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more