What Monocle tracks
- Hit rate with color-coded percentage (green for healthy, red for low)
- Total operations count and average/P95 latency
- Hit/miss chart showing cache efficiency over time
- Latency chart tracking response time trends
- Per-key breakdown with individual hit/miss ratio and latency metrics
Key sanitization
Cache keys often contain dynamic values (user IDs, UUIDs, session tokens) that would create high-cardinality attributes. Monocle automatically sanitizes keys by replacing dynamic segments with*:
users:550e8400-e29b-41d4-a716-446655440000becomesusers:*post:12345becomespost:*hash:a1b2c3d4e5f6becomeshash:*
Span attributes
All cache instrumentations must emit these attributes for the Cache dashboard to work correctly.| Attribute | Dashboard Feature |
|---|---|
cache.operation | Operation type grouping (get, set, getOrSet, delete, etc.) |
cache.key | Per-key breakdown table (sanitized) |
cache.hit | Hit rate calculation and hit/miss charts |
cache.store | Cache store identification |
Supported libraries
Bentocache
Multi-tier caching library for Node.js. Instrumentation provided by
@bentocache/otel.