Observability
Feuer uses mixtrics for metrics,
tracing for recovery logs, and has
built-in access-trace capture so you can replay production traffic offline.
Metrics
Pass a mixtrics::metrics::BoxedRegistry to .with_metrics(...). You own the
registry and plug in whatever exporter you use (Prometheus, OpenTelemetry, etc.):
use mixtrics::{
metrics::BoxedRegistry,
registry::prometheus::PrometheusMetricsRegistry,
};
let prometheus_registry = prometheus::Registry::new();
let metrics_registry: BoxedRegistry =
Box::new(PrometheusMetricsRegistry::new(prometheus_registry.clone()));
let cache = feuer::Cache::builder()
.memory_capacity(64 << 20)
.with_metrics(&metrics_registry)
.open()?;
Labels are fixed and low-cardinality (never object keys, paths, or cache names). If you pass the same registry to multiple caches, their metrics get aggregated. Use separate registries if you want them split out.
Key metrics
| Metric | Type | What it tracks |
|---|---|---|
feuer_lookup_total | Counter | Completed lookups by outcome (memory_hit, disk_hit, callback, callback_error, miss) |
feuer_lookup_duration_seconds | Histogram | Latency of disk_hit and callback lookups by payload size_range |
feuer_lookup_bytes_total | Counter | Bytes returned by source (memory, disk, callback) |
feuer_admission_filter_total | Counter | Filter results by tier (memory, disk) and outcome (accepted, rejected) |
feuer_disk_lookup_total | Counter | Disk outcomes (hit, absent, io_error, checksum_failed, fallthrough) |
feuer_disk_chunks | Gauge | 1-MiB chunks by state (free, allocated) |
feuer_disk_payload_bytes | Gauge | Indexed payload bytes on disk (excluding padding and metadata) |
feuer_disk_batch_bytes_total | Counter | Written payload vs. chunk bytes (packing efficiency) |
For the full list (including memory eviction, buffer pools, write queues, and
read queue waits), see
metrics.md.
Recovery logs
Enable feuer::storage=info in your tracing filter to log disk recovery
summaries on open.
Access traces and offline replay
Instead of guessing cache sizes or eviction weights, you can record production accesses and replay them offline.
Attach a delivery callback with .with_trace(...) before sharing the cache:
let cache = feuer::Cache::builder()
.memory_capacity(64 << 20)
.open()?
.with_trace(|package: bytes::Bytes| async move {
// Persist the uncompressed FETR v1 package.
persist_package(package).await
});
- Every lookup writes a start event and an outcome event (41 bytes each) with the 128-bit key hash and payload size, without payload bytes.
- A background task batches events into 8-MiB
FETR v1packages and calls your callback serially. If the 65,536-event queue fills up, events are dropped so slow storage never slows down lookups. - Key hashes can still identify objects, so treat trace files as sensitive.
- Dropping the last cache handle triggers delivery of whatever is buffered without waiting. Make sure you wait for your callback to finish before shutting down the runtime.
See trace_to_disk.rs
for a working example,
access-trace.md
for the FETR v1 format, and
feuer-replay
for replaying traces.