Expand description
Optional audit-stream-py producer. Gated behind the audit-stream
Cargo feature so the core toolkit stays HTTP-free.
Optional audit-stream-py producer.
When the audit-stream Cargo feature is enabled and the
AUDIT_STREAM_URL env var is set, an AuditingBreaker fires
governance events on every circuit-breaker state transition worth
recording:
breaker_opened— closed/half-open → open. The “we just stopped trusting a downstream” signal.breaker_recovered— half-open → closed. The “downstream looks healthy again” signal.
Manual AuditingBreaker::trip / AuditingBreaker::reset also
fire when they cause a real state change.
Same opt-in pattern as the other Rust producers (hash-attestation, incident-correlation, aeo-graph-explorer). Identical env-var contract:
AUDIT_STREAM_URL— base URL, e.g.http://audit.local:8093AUDIT_STREAM_TIMEOUT_S— per-call timeout, default 2.5s
Best-effort. Failures are logged to stderr and swallowed — an audit-stream outage must never block a call gated by the breaker.
Structs§
- Auditing
Breaker - Wraps a
CircuitBreakerwith a name + audit-stream client so that state transitions fan out as governance events.
Constants§
- DEFAULT_
TIMEOUT_ S - Default per-call timeout when
AUDIT_STREAM_TIMEOUT_Sis unset.
Functions§
- base_
url - Stripped audit-stream base URL, or
Nonewhen disabled. - emit
- Fire one event. Silent no-op when
AUDIT_STREAM_URLis unset. - is_
enabled - True when
AUDIT_STREAM_URLis set to a non-empty value. - timeout
- Configured per-call timeout. Defaults to 2.5 seconds.