Spectra

Visibility and benchmark proof

Spectra is a Rust observability library built around declarative schemas and ergonomic typed logging APIs—counters, gauges, and structured event logs with the same emit surface from embedded single-process to multi-service clusters.

Why this family exists

Benchmarks and product health need typed metrics and classified events, not ad hoc println. Spectra owns observability semantics: classification metadata, emit buffering, registry discovery, and query DTOs. Storage engines live in feature-gated spectra-backend-* crates (mem, sqlite, tensorbase/ClickHouse-shaped adapters). Wire Spectra::builder() at boot the same way Continuum and Photon assemble ports.

Where it lands

Spectra will attach run metrics, device profiles, and traces to the marketing benchmark library and family runtimes—same schemas from local mem proofs to cluster-backed stores.
Define spectra_schema! and spectra_metric! macros—no build.rs required—then emit through typed Recorder/Logger helpers. Topology is embedded (in-process store) or remote (network-backed); optional SpectraSink fans emits to a transport you own while async storage persists. Same APIs whether you are proving Boson claim rates or tracing Valence request debug logs. Published as uf-spectra; imports stay use spectra::….

On the roadmap

Spectra will attach run metrics, device profiles, and traces to the marketing benchmark library and family runtimes—same schemas from local mem proofs to cluster-backed stores.

Code sample

From the upstream getting-started docs — see also all code recipes on Resources.
Spectra schemaSpectra
Declarative metrics + event schemas
use spectra_macros::{spectra_metric, spectra_schema};

spectra_schema! {
    RequestDebugLog {
        store: "default",
        table: "request_debug_log",
        version: "0.1.0",
        description: "Structured debug events for request tracing",
        fields: [
            message: {
                r#type: String,
                classification: { pii: false, safe_for_console: true },
            },
        ],
    }
}

spectra_metric! {
    CacheHits {
        store: "default",
        name: "cache_hits",
        version: "0.1.0",
        description: "Counter for cache hit events",
    }
}