Expand description
Span helpers that pull connection / transaction / tenant / auth
context out of the runtime thread-locals and attach them to a
tracing::Span. Any log emitted while the span is entered picks
up these fields automatically — the caller never has to pass
conn_id / xid / tenant as parameters down through the call
graph.
Usage:
ⓘ
use reddb::telemetry::span;
let _g = span::query_span(query).entered();
// subsequent tracing::info!/warn!/error! carry conn_id+xid+tenantFunctions§
- connection_
span - Span for a new wire/gRPC/HTTP connection. Call at accept time so every log inside that connection’s lifetime carries the remote peer and transport kind.
- listener_
span - Span for a listener bind — emits once at startup to mark the transport as ready.
- query_
span - Span wrapping a single
execute_querycall. Stamps the current connection id, transaction xid (0 when autocommit), tenant, and authenticated user so every downstream event (filter eval, scan, CDC emit, error) inherits correlation context.