Expand description
Live match-trace channel — RFC 006 (in-process) + RFC 009 (transport).
§Architecture
HTTP handler ──► TraceEmitter::emit()
│
tokio::sync::broadcast (bounded, 1024)
│
┌─────────────┴──────────────┐
in-process TraceTransport::accept_loop
subscriber (UDS on Unix, TCP fallback)
│
up to 4 GUI connections
(newline-delimited JSON)§Transport variants
TraceTransportConfig | Platform | Notes |
|---|---|---|
Uds { path } | Unix/macOS | Default when available |
Tcp { addr } | All | Portable fallback; addr = "127.0.0.1:0" assigns ephemeral port |
Disabled | All | No out-of-process forwarding (default) |
§Back-pressure
The broadcast channel is bounded by TRACE_CHANNEL_CAPACITY. When
the channel is full, emit drops the event and increments an internal
counter; the count is reported as dropped_count on the next event.
Slow out-of-process subscribers receive a RecvError::Lagged from the
broadcast channel; the gap is reported in the next JSON line via
dropped_count.
§Subscriber cap
At most MAX_SUBSCRIBERS out-of-process connections are accepted.
A fifth connection receives {"error":"max_subscribers_reached"} and
is then closed.
Structs§
- Match
Trace Event - A single request/response trace event.
- Request
Summary - Key fields from the incoming HTTP request.
- Trace
Config - Trace-channel behaviour configuration (RFC 023, extended by RFC 040).
- Trace
Emitter - Shared handle to the trace broadcast channel.
- Trace
Transport
Enums§
- Header
Redaction Mode - Which request headers get redacted before a trace event is built (RFC 040 Q1).
- Outcome
- What the server decided to do with the request.
- Trace
Transport Config - Configuration for the out-of-process transport layer.
Constants§
- DEFAULT_
HEADER_ DENYLIST - Built-in denylist of well-known credential-bearing request headers, applied by default (RFC 040 Q1). Compared case-insensitively.
- MAX_
SUBSCRIBERS - Maximum concurrent out-of-process subscriber connections.
- REDACTED_
HEADER_ VALUE - Placeholder value substituted for a redacted header (RFC 040 Goal 4). The header name is kept so a consumer can tell “redacted” from “the request never sent this header” — only the value differs.
- TRACE_
CHANNEL_ CAPACITY - Capacity of the broadcast channel (events).
Functions§
- now_ms
- Current Unix time in milliseconds.