Files
cozystack/internal/observabilityproxy
ZverGuy 560e4d7ba5 fix(observability-proxy): count the query lookback in the store choice
The short-term store was picked from the request window alone, so an
instant increase(x[7d]) or x offset 10d went to the store that keeps
72h and silently returned a wrong number.

A lexical scan of the query now bounds how far back it reads: the sum
of every [...] window and subquery step, positive offsets, and the
step and silence interval vmselect reads before each rollup. An @
modifier, step-multiple units or any duration the scan cannot read
make the bound unknown and pick the long-term store, which receives
the same writes. The scan sees quoted label values too, so a false
hit only moves a query to the long-term store. The query is still
forwarded unchanged.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
..