docs

Cache

Cache hit rate, latency and operations for every sanitized cache key pattern.

Cache shows how well your cache works: the share of lookups it answers, how fast it answers, and which keys miss most. Use it when the database is busier than it should be, or after you change a TTL.

The list lives at /o/:org/projects/:project/cache and a key at /o/:org/projects/:project/cache/detail?key=....

Where the data comes from

Any span with cache.operation is a cache operation. The Bentocache instrumentation produces them for Bentocache, which @adonisjs/cache is built on.

AttributeUsed for
cache.operationOperation name, such as get, set or getOrSet
cache.storeStore that served the operation
cache.keyGrouping key, after sanitizing
cache.hittrue or false. Lookups without it count as neither hit nor miss

Hit rate is hits over hits plus misses. Writes and deletes have no cache.hit, so they count as operations but do not dilute the hit rate.

How keys are grouped

Keys usually embed IDs, so Unhandled groups them into patterns. The key is split on :, / and ., and each segment that looks like an ID becomes *: all digits, a UUID, 8 or more hex characters, an email address, or at least 16 word characters including a digit.

users:42:profile                      users:*:profile
orders/0b4f6c2e-8a1d-4c3e-9f7a-1234567890ab   orders/*

The Bentocache instrumentation already sanitizes keys before export, using : as the separator. Its keySanitizer option replaces that step, and includeKeys: false drops keys entirely, in which case operations group by span name.

The list

CardValueHint
Hit RateHits over lookups, green at 80% or above, red belowNumber of hits
Total OperationsAll operationsNumber of key patterns
LatencyMean operation timeP95
MissesNumber of missesShare of lookups

Hits and Misses stacks lookups per bucket by cache.hit. Latency plots average and P95.

The table lists up to 200 key patterns with Service, Key, Operations, Hits, Misses, Hit rate, Avg and P95. Sort by Operations (the default), Avg or P95.

Key detail

The detail page repeats the cards and charts for one key pattern. When several services use it and you arrived without a service, it asks you to choose one first.

Operations splits the key's traffic by cache.operation and cache.store, with Calls, Hit rate, Avg and P95 for each. A getOrSet with a low hit rate means the value expires before it is read again.

Recent executions lists the 50 latest operations with Time, Operation, Store, Result (Hit or Miss), Origin, Duration and a trace link. Origin is the route, job or command that touched the key. Filter by All or Failed. Show switches between Recent, the default, and Slowest.

Answering "why does the product page hit the database every time?"

  1. Sort by Operations and find the product key pattern.
  2. A low Hit rate with many misses means values are evicted or expire too early.
  3. Open the key and check Operations. Many set calls next to the misses point to a TTL that is too short, or a key that changes on every request.
  4. Use Origin in Recent executions to find the route that misses most.