Agent skill
cache-observability
Track cache hit rates, latency, and detect cache-related issues
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/cache-observability
SKILL.md
Cache Observability
Cache is performance-critical. Track hit rate, latency, and evictions.
Key Metrics
| Metric | Type | Description |
|---|---|---|
cache.hits |
Counter | Successful reads |
cache.misses |
Counter | Reads that missed |
cache.gets.duration |
Histogram | GET latency |
cache.evictions |
Counter | Keys evicted |
cache.memory.used |
Gauge | Memory consumption |
Span Attributes
| Attribute | Example | Required |
|---|---|---|
cache.system |
redis, memcached | Yes |
cache.operation |
GET, SET | Yes |
cache.hit |
true/false | Yes |
cache.key_prefix |
user:* | Recommended (not full key!) |
Hit Rate
hit_rate = cache.hits / (cache.hits + cache.misses)
- Good: >90%
- Concerning: <80% → Check TTL, warming strategy
Issues to Detect
| Issue | Detection | Fix |
|---|---|---|
| Low hit rate | <80% | Tune TTL, warm cache |
| Cache stampede | Many misses for same key | Distributed locks |
| High latency | p99 >10ms | Check network, value size |
| Memory pressure | memory >90% of max | Eviction policy, sizing |
Cache Wrapper Pattern
Before GET: Start timer
After GET: Record duration, increment hits or misses, set cache.hit on span
Anti-Patterns
- Full keys in metrics → High cardinality, use prefix only
- No eviction monitoring → Can't detect memory pressure
- Ignoring serialization time → Track total time including marshal
References
references/platforms/{platform}/cache.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?