Expand description
Three-tier in-memory ring buffer for per-service metrics.
Each service gets three retention tiers:
- Tier 0: 1-min granularity, 15 samples (15 min window)
- Tier 1: 15-min granularity, 16 samples (4 h window)
- Tier 2: 4-hour granularity, 18 samples (72 h window)
A background sampler task reads atomic counters once per minute and pushes samples into tier 0. Rollups cascade automatically.
Structsยง
- Metric
Sample - One sample point for a single service.
- Metrics
Store - Top-level per-service metrics store, keyed by service type (
ResourceTypeasi32). - Service
Counters - Atomic counters that services increment in their hot paths.