Repository navigation
cache metrics: LRU entries & capacity - #4384
Closed
larry-dalmeida wants to merge 1 commit into
Closed
larry-dalmeida wants to merge 1 commit into
larry-dalmeida wants to merge 1 commit into
Conversation
This was referenced Oct 26, 2026
larry-dalmeida
force-pushed
the
metrics-a-lru-gauges
branch
from
October 26, 2026 13:25
359a9c2 to
88dea22
Compare
Add skipper_cache_lru_entries{route} and skipper_cache_lru_capacity_bytes gauges. ShardedByteLRU.Usage returns bytes and entry count together; Bytes delegates to it.
Signed-off-by: Larry D Almeida <hello@larrydalmeida.com>
larry-dalmeida
force-pushed
the
metrics-a-lru-gauges
branch
from
October 26, 2026 14:36
88dea22 to
561e3c2
Compare
larry-dalmeida
force-pushed
the
larry-almeida-zse-cache-timeouts-pr
branch
from
October 26, 2026 14:37
509147c to
7e48ec0
Compare
This was referenced Oct 26, 2026
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Adds LRU entry count and total capacity gauges for per-route cache monitoring.
How to Verify
Shared setup
make verifystarts or reuses Minikube, the mock origin and the stack; runs the smoke and coalescing checks; and validates supported dashboard queries. It prints a report path and exits non-zero on failure. For outage evidence, runmake chaos SKIPPER_CHECKOUT=../skipper-pr-4387 NAME=origin-stale; it includes its own timed load. Requirements: Python 3.9+, Make, Bash, Git, curl, kubectl, Minikube, Docker and Go compatible with Skipper'sgo.mod. Free ports: 8080, 8081, 6379, 4318, 9091, 9999, 9911 (8089 for endless load). Dynamic URLs:.runtime/urls.txt; stop withmake stop.Validated on #4387 (
d767f636): smoke: 6,398 requests, 0 failures; origin-stale: 155 failed revalidations across 77 routes. Smoke metric checks: 42 PASS, 2 fault-only NOT EXERCISED, 0 FAIL.Focused tests
Expected: Both focused tests pass. Smoke shows entries grow and level off as route keys warm (about 990 entries/route); bytes remain far below the 2 GiB default (about 1 MB).
Checklist
Rollback Plan
Revert this PR to restore previous metrics behavior.
References & Additional Context
Base of metrics stack; followed by #4385. Adds
skipper_cache_lru_entries(labelled by route) andskipper_cache_lru_capacity_bytes(the configured L1 limit) so L1 fill can be compared with capacity.E2E Testing Results
The screenshots below come from a 2-minute smoke run (
20261026-145513-smoke) againstbda674b0, the top of this stack, which includes this PR. They showskipper_cache_lru_entriesgrowing as keys are cached, andskipper_cache_lru_bytesplotted against the constantskipper_cache_lru_capacity_bytes(2 GiB). Full results: larry-dalmeida/skipper-cache-e2e-tests/resultsTest Scenarios:
20261026-145513-smokebda674b0(top of this stack)20261025-201019-smoke8a80d62e+ uncommitted changes20261025-201220-origin-stale8a80d62e+ uncommitted changes20261025-202222-skipper-kill8a80d62e+ uncommitted changesValidation Panels:
Cache entries —

skipper_cache_lru_entriesclimbs from 2 to about 860 entries during the 2-minute run as new keys are cached. It is still rising at the end, with no plateau in this run.Cache bytes vs capacity —

skipper_cache_lru_capacity_bytesis a flat line at 2 GiB.skipper_cache_lru_bytesreaches only about 540 KiB, so at this scale it sits on the 0 B axis. L1 stays far below capacity.Cache hit ratio (context) — overall hit ratio for the run is 74.2%. Context only; this panel does not use a metric added by this PR.
