Spectra

Traces, health, alerting, and logging

Typed metrics, traces, and event logs from one process to a cluster.

Why this family exists

Define spectra_schema! and spectra_metric! for typed counters, gauges, and classified events. Storage engines live in feature-gated spectra-backend-* crates for mem, SQLite, and cluster stores.

Where it lands

The same typed schemas can persist in-process or through feature-gated remote stores.
Emit through typed Recorder and Logger helpers. Run with an in-process store or a network-backed store, and add SpectraSink when another transport needs the same events. The capacity campaign measures zero-loss writes with blocking overflow, batches of 2,048, paced input, and query visibility. Resources keeps the qualified ClickHouse overload ceiling as a component study. Published on crates.io as uf-spectra; Rust imports use spectra::.

Published library

The same typed schemas can persist in-process or through feature-gated remote 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",
    }
}