Skip to main content

Module metrics

Module metrics 

Source
Expand description

Live hit/miss counters, the SaaS telemetry headers built from them, and (feature tracing) structured events for cache operations. Telemetry: live hit/miss counters, the X-CacheKit-* SaaS telemetry headers built from them, and — behind the tracing feature — structured events for cache operations.

Counters are owned by a CacheKit and shared by its clones; read a snapshot with CacheKit::stats. At build time the client hands a MetricsProvider over those counters to the backend (Backend::attach_metrics), so the cachekit.io backends’ telemetry headers report real numbers with no user plumbing. A provider given to the backend’s own builder takes precedence.

Structs§

L1Stats
Snapshot of cache hit statistics for one CacheKit and all of its clones.

Functions§

key_hash
Blake2b-128 digest of a storage key as 32 lowercase hex characters.
metrics_headers
Build X-CacheKit-* HTTP headers from the current L1 stats provider.

Type Aliases§

MetricsProvider
Thread-safe closure that produces an optional L1Stats snapshot.