Expand description
Analytics sink extension point.
§Contract: AnalyticsSink
Purpose: accept request/flow events emitted by the dataplane. The sink is fire-and-forget from the caller’s perspective.
Semantics: record appends one event and must not block the caller
beyond a bounded enqueue. Implementations bound themselves (ring buffer,
batch, drop-oldest) — an analytics overload must never stall the
dataplane. Ordering is best-effort; events may be coalesced or dropped
under pressure, and record returning Ok means “accepted”, not
“durably persisted”. Events must not contain secret material.
Failure model: only enqueue failures (closed channel, full local
buffer) produce ExtensionsError::Backend; call sites should log and
continue, never fail the request. No retries.
Editions: OSS ships InMemoryAnalyticsSink (bounded ring buffer)
and the DW-043 embedded store (analytics::EmbeddedAnalytics, SQLite
rollups), which implements this contract on top of the richer
per-request fields below. Ent planned: federated sink + warehouse
export (DW-095). The raw-record firehose (DW-121) deliberately does
NOT implement this contract: it streams the access record itself
(with request_id and the redacted path this event shape omits)
through its own sink seam — see events::stream.
Structs§
- Event
- A single analytics event.
- InMemory
Analytics Sink - Bounded in-memory ring-buffer sink (OSS skeleton).
Traits§
- Analytics
Sink - Swappable analytics event sink.