Expand description
Trace records and context snapshots.
A Trace is one policy execution — a live request or a sandbox run —
recorded as an initial ContextSnapshot plus one NodeStep per node
the engine walked.
§Why one snapshot per step, not before/after pairs
The Context flows strictly linearly: every plugin takes it by value and
hands it back in both the Ok and Err arms of PluginResult, so
before(step N) == after(step N - 1) and before(step 0) == Trace::initial
are guaranteed by the plugin contract itself. Storing explicit pairs would
double memory for exactly zero information.
The “what did this plugin change” view is therefore derived, not stored:
see crate::debug::diff, which is computed at read time so the traced
request path stays cheap.
Structs§
- Body
Capture - How a captured body was handled.
- Capture
Options - Knobs for capturing a snapshot, resolved from
DebugConfig. - Context
Snapshot - A redacted point-in-time view of the whole
Context. - Node
Step - One node execution.
- Previous
Bodies - The bodies seen at the previous step, used to avoid storing an unchanged
body once per node. Cloning
Bytesis a refcount bump, not a copy. - Redaction
Policy - Case-insensitive denylists used when capturing a snapshot.
- Request
Snapshot - Redacted view of
Context.request. - Response
Snapshot - Redacted view of
Context.response. - Trace
- One complete policy execution.
Enums§
- Edge
Kind - Which edge the engine followed after a node — including the cases where
there was none, which is what makes an unwired
errorport visible. - Step
Outcome - Whether a node returned success or routed through its error port.
- Trace
Source - Whether a trace came from live traffic or a sandbox run.
Constants§
- DEFAULT_
REDACT_ 🔒HEADERS - Header names always redacted, regardless of configuration.
- DEFAULT_
REDACT_ 🔒MESSAGE_ SUBSTRINGS - Substrings that mark a
context.messagekey as secret-bearing. - DEFAULT_
REDACT_ 🔒QUERY - Query parameters always redacted. OAuth/OIDC put codes and tokens in the
query string, so omitting these would leak on every
openid-connecttrace. - REDACTED
- Placeholder substituted for any value the redaction policy matches.
Functions§
- capture_
body 🔒 - Records the body length always, and the text only when capture is on and the bytes differ from the previous step.
- redact_
map 🔒 - Redacts a header/query map into a deterministic
BTreeMap, preserving the arity of multi-valued entries so the shape of the request is still visible.