Skip to main content

Module capture

Module capture 

Source
Expand description

Content capture.

Turns serialized inputs/outputs into BlobRefs and persists the bytes to a BlobStore, gated by the configured CapturePolicy. The instrumentation macros and SpanBuilder call capture_json to populate a span’s input_ref / output_ref.

Capture is opt-in at the process level: until init_capture runs (which init_local does for you), capture_enabled is false and nothing is serialized or stored, so a MetadataOnly deployment pays no cost.

Structs§

CaptureConfig
Process-wide capture configuration.
FsBlobStore
Filesystem blob store: writes each blob to dir/<hash>. Used by init_local.
MemoryBlobStore
In-memory blob store, handy for tests and ephemeral runs.

Functions§

capture_enabled
Whether content capture is active. false when capture is uninitialized or the policy is MetadataOnly; callers should skip serialization entirely in that case.
capture_json
Serialize already-built JSON content into a stored blob and return a BlobRef describing it, honoring the configured policy. Returns None when capture is disabled.
capture_policy
The active process-wide capture policy, or CapturePolicy::MetadataOnly when capture has not been initialized.
init_capture
Install the process-wide capture configuration. Errors if already set.
redact_text
Redact text with the configured redactor, falling back to the default regex redactor even when content capture has not been initialized.