You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cache: add a counter metric for outboard declines #2855
An HTTP origin that declines an outboard GET (401/403/3xx, or another non-retriable non-404 status such as 400/405/410) warns once per origin per status class, then logs at debug (#2853). That keeps an origin that answers 403 for a missing key from warning on every cold miss, but the warn-once cannot tell a new ACL break (a 403 during a real outage) from that steady-state 403-for-missing. The warn re-arms only on node restart. Only a rate can tell the two apart.
Keep the warn-once as the first log notice; add a counter next to it.
Goal
Count every outboard decline, e.g. decdn_cache_origin_outboard_declines_total{kind, class} in CacheMetrics, where kind is the origin kind and class the decline reason (401, 403, 3xx, other 4xx, oversize). Cover:
HTTP status declines (HttpOrigin::get_outboard_bounded)
oversize-outboard declines (advertised Content-Length over the cap, and a body that runs past it), in HTTP and S3
S3 declines
Implementation options
A. Carry a reason on the variant.OutboardFetch::Unsupported carries the decline class, and the engine counts it where it already maps Unsupported to Declined (fetch_gated_outboard).
+ The adapters stay free of metrics, and all adapters are counted the same way.
- A contract change across all three adapters (cheap pre-mainnet).
B. Pass Arc<CacheMetrics> into HttpOrigin, which counts in the adapter.
+ A smaller change, HTTP adapter only.
- The adapter now depends on metrics, and S3 and oversize declines need separate plumbing.
Done when
Every outboard decline increments the counter with its kind and class.
The warn-once log stays as it is.
A test pins one increment per decline for at least the HTTP 403 and oversize cases.
Activity
alpergundogdu commentedon Nov 11, 2026
Closing as won't-fix: the warn-once log is enough until an operator needs a decline rate. Reopen if one does.