Expand description
Runtime assembly: builder, async storage persist, and optional off-thread telemetry I/O.
Application crates usually depend on spectra instead of this crate directly.
Spectra::builder()/SpectraBuilder— inject backends, optional transport sink, and topology flagsSpectraBuilder::persist— L2 queue/batch settings (PersistConfig; no env knobs)Spectra::flush_persist— durable barrier after*_nowemits (Write Now scripts)SpectraBuilder::sink+SpectraBuilder::persist_disabled— publisher wiring for distributed ingest (consumers own storage; seespectraGetting started → Mode 2)StoragePersistSink— default async persist to registered storage backendsOffThreadSpectraSink— off-thread NDJSON + console mirror (telemetry-consolefeature)- Both
metrics_backendandevents_backendare required beforeSpectraBuilder::build. - With
persist_disabled, a transport.sinkis mandatory.
Structs§
- OffThread
Spectra Sink - Sink that enqueues NDJSON + optional console mirror work for a background thread.
- Persist
Config - Queue and batch settings for
crate::StoragePersistSink. - Persist
Handle - Handle to wait until the persist queue has drained prior emits.
- Spectra
- Handle to an installed process-wide Spectra runtime.
- Spectra
Builder - Configures and installs
Spectrawith explicit storage adapter injection. - Storage
Persist Sink SpectraSinkthat queues telemetry for asynchronous storage through aSpectraRouter.
Enums§
- Persist
Overflow - Behavior when the L2 persist queue is full.
Functions§
- console_
mirror_ enabled - Returns true when stderr console mirror is enabled (default: true).
- format_
console_ line - Build a single
[spectra:console]line when schema fields are console-safe. - off_
thread_ emit_ enabled - Returns true when hot-path emit should use the off-thread writer (default: true).