Commit Graph
661 Commits
Author SHA1 Message Date
ZverGuy dd7116ea45 fix(observability-proxy): check the lookup cap before dropping empty names
The store cuts a lookup at the cap plus one value. Dropping empty
values first could bring such a cut list back under the cap and serve
it as complete, hiding the application's other pods without the 422
that asks for a shorter range.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 04:03:24 +07:00
ZverGuy e6697ea4f1 test(observability-proxy): cover malformed pod lookups and the lookup window
An empty name in a lookup answer would turn the pod branch into a
pattern that matches every series without a pod label, widening the
application scope to the namespace; nothing pinned the guard against
it. Malformed answers must only drop their branch, and the lookup must
start at the query's own lookback, or at the configured limit when that
lookback is unknown.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 04:03:24 +07:00
ZverGuy dcdf0adab3 feat(observability-proxy): serve the application metrics root
Graphs of one application need its series without the caller knowing
which pods and volumes it ran on. Exporter series carry the identity
the scrape class stamps, but cAdvisor and kubelet volume series do not,
so the scope ORs three branches: the identity, and the application's
pods and PVCs as kube-state-metrics labelled them over the window. Each
branch also carries the namespace, so the scope is never wider than the
namespace root.

The lookup reaches back by the query's own lookback, bounded by a flag,
so pods replaced inside an expression's range still count. A failed
lookup only drops its branch. A list over its cap answers 422 instead
of being truncated, which would hide series without saying so.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 04:03:24 +07:00
ZverGuy 2f600d5354 feat(observability-proxy): serve the application logs root
A viewer of one application gets that application's lines without
writing a namespace query and filtering by hand, and a grant narrowed to
one application by resourceNames is honoured on every logs endpoint,
tail and the pickers included. The namespace filter stays and the
application's identity is ANDed next to it as a second stream filter,
so the result can only be narrower than the namespace root.

The plural is mapped to its kind only after the caller is authorized,
so an anonymous client cannot probe which applications exist, and the
proxy is not ready until the ApplicationDefinitions cache is.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 04:03:24 +07:00
ZverGuy ecb5de6051 feat(observability-proxy): map application plurals to their kinds
Paths and RBAC name an application by its plural, while the lineage
labels that scope its logs and series carry the kind. The mapping comes
from ApplicationDefinitions, kept in one place so both application roots
scope by the same kind. A plural declared for two kinds is refused
rather than resolved by cache order.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 04:03:24 +07:00
ZverGuy 16bcaa447d test(observability-proxy): cover stalled reviews on the metrics root
The metrics handler shares the bounded review calls with the logs
handler; a POST to it with an unread body must answer 503 as well
rather than wait on a stalled kube-apiserver.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:27 +07:00
ZverGuy 41b3237c07 refactor(observability-proxy): state the keyword and duration tests positively
staticcheck flags the negated disjunctions; naming the duration
characters and spelling out both word boundaries reads the same way the
rule is stated.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 89fbdb136f test(observability-proxy): cover the 1970 bound of metrics times
Only the upper half of the refused 1970..2262 range had a test, so
the lower check could be dropped unnoticed. vmselect clamps a time
before 1970 to 0, which would answer for a window other than the one
asked for.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 65944fcb79 fix(observability-proxy): send metrics times vmselect cannot misread
Times went to vmselect as "%d.%03d" unix seconds. vmselect reads a
number without "-" as a unix time whose unit it guesses from its size,
so a time in the first 24.8 days of 1970 arrived as a thousand times
as many seconds: a window the proxy checked as 8.8 days and 30 points
reached vmselect as 2001..2025 and 30000 points, and the label and
series APIs, which have no points check, scanned the whole retention.
Times past 2038 were read as microseconds.

Times now go out as RFC3339 with milliseconds, which vmselect parses
as a date and never as a guessed unit, and times outside 1970..2262,
which vmselect cannot hold as nanoseconds, are refused. A test repeats
vmselect's parsing of the exact strings the proxy sends.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy ec251cbd3b test(observability-proxy): watch the metrics slot instead of probing
The metrics slow-body and stalled-client tests probed the slot with
requests of their own, which competed for the one slot under test and
made them fail at random, under one shuffle seed reliably. They now
read the limiter's slot count, as the logs tests do; 300 runs of the
test and 20 shuffled runs of the package pass.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy d2feb9b7c2 test(observability-proxy): pin the metrics concurrency Retry-After value
The metrics concurrency test only checked that a Retry-After was
present, while the rate limit test pins its value, so a change to the
promised hint passed. It now expects the literal value.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 3a5bcf2567 fix(observability-proxy): send durations vmselect reads back exactly
vmselect reads step and timeout as float seconds multiplied by 1000
and truncated, so a step the proxy checked as 1001ms and sent as
"1.001" arrived as 1000ms. The points limit was then checked against
a coarser step than vmselect used: a limit of 11000 let 11010 points
through, and many steps between 1ms and 100000s were affected.

Durations are now written so that the truncation lands on the
milliseconds the limits were checked with: the shortest form when it
reads back exactly, otherwise with half a millisecond added. Step and
timeout share the formatter, and a sweep test mirrors vmselect's
parsing.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 843d360ee0 fix(observability-proxy): send Retry-After with the metrics concurrency 429
The metrics root has its own admission, so the hint added to the logs
root did not reach it, and a console graph polling into the limit had
no back-off hint.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy b4ddb93b6f docs(observability-proxy): name the timeout as the bound on rollup work
vmselect's sample limit counts raw samples read, not the work of a
rollup that revisits each sample across overlapping windows, so for
that work the forwarded timeout is the limit that applies.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy eaadba4add docs(observability-proxy): state what the metrics limits bound
The comment claimed the limits bound everything a request makes
vmselect do, but windows and offsets inside the expression pass
through unchecked: they are bounded by the store's retention and by
vmselect's own series and sample limits, not by the proxy. A reader
taking the comment at its word would rely on a cost cap that does not
exist.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 6f5b0b666e fix(observability-proxy): check metrics points on millisecond bounds
The points limit was checked on the parsed bounds, but vmselect gets
both cut to the millisecond. A start cut back by more than the end
widened the forwarded range, so a 1ms step admitted at 11000 points
reached vmselect as 11001.

Times are now cut to the millisecond when they are parsed, so the
range and points checks and the forwarded request see one window.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 0d3a0487e4 fix(observability-proxy): bound the metrics request lifetime
The metrics root parsed its form before taking a concurrency slot,
under no read deadline, and wrote its answer under no write deadline,
so a client that sent its body slowly or stopped reading held the
handler outside every limit. A store answer that broke off after the
status line still ended as a clean 200.

The metrics handler now follows the logs root: the slot is taken
before the body is read under the request timeout, the answer must be
taken by the request deadline, and a failed copy cuts the connection.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 1ead35a37a fix(observability-proxy): bound implicit subqueries and WITH templates
The lookback scan assumed every window and offset applies once and
explicitly. A rollup function or offset over anything but a selector is
an implicit subquery in vmselect, so every "(" now counts as one level;
a WITH template can apply one window several times, so WITH makes the
bound unknown; and an offset written with digit separators was read as
its first digits only, so "_" now ends in an unknown bound instead.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 2fad05b01f fix(observability-proxy): count the latency offset in instant lookback
vmselect moves an instant query evaluated near the current time back by
-search.latencyOffset (30s). With a tiny explicit step the lookback
bound did not cover that shift, so a window ending at the retention
edge could still be sent to the short-term store.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
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
ZverGuy 19030c7a1a fix(observability-proxy): answer 429 to the metrics concurrency limit
The logs root answers 429 when a user has too many requests in flight,
so clients back off instead of treating the refusal as a bad query.
The metrics root kept its own 422 for the same limit; it now matches.
The rate limit is shared and already answers 429 with Retry-After,
which the metrics test now expects too.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 6d6f05a1c7 fix(observability-proxy): refuse metrics durations vmselect would refuse
Rounding a duration up to the millisecond overflows for values within
a millisecond of the largest one, which turned such a step or timeout
negative and let it past the range, points and timeout limits. vmselect
refuses durations above 100 years itself, so the proxy now answers 400
for them before rounding.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 81cd278f63 test(observability-proxy): cover metrics concurrency and flag overrides
The per-user concurrency cap on the metrics root had no test, so
dropping it from the handler went unnoticed. The new test holds one
request in the upstream, expects the same user's second one to be
refused and another user's to go through. Overrides of the metrics
flags were only checked for their defaults and refusals.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 1ac7fd29bf fix(observability-proxy): round the metrics step up to whole milliseconds
vmselect reads step and timeout in whole milliseconds and drops the
remainder, so a step of 1.9ms passed the points check as 1.9ms and
then ran as 1ms, close to twice the points the limit allows. The
duration is now rounded up before the limits are checked, so they see
the value vmselect will use.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 47409db70c feat(observability-proxy): serve the namespace metrics root
The namespace metrics root shares the logs root's authorization path:
the SubjectAccessReview comes from the path alone, so a POST query,
which Grafana sends by default, is authorized exactly like a GET. Both
roots also share the per-user rate and concurrency limits and the way
an unreachable store (502) is told apart from a slow one (504); the
upstream call moves into one helper so the two stay identical.

Every namespace resolves to the root tenant's vmselect for now,
because the series the graphs need are only scraped there.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 4f3260e5d4 feat(observability-proxy): rebuild metrics queries from an allowlist
vmselect ORs repeated extra_filters, so a client-supplied value would
widen the tenant scope. The upstream request is therefore built from
scratch: only query, start, end, step, time, match[] and a clamped
timeout are read from the client, and the namespace selector is sent
as the single extra_filters[] value. The query itself is not parsed;
vmselect ANDs that filter into every selector.

The label endpoints always carry a match[] (the namespace selector
when the client sent none), because a vmselect started with
-search.ignoreExtraFiltersAtLabelsAPI applies extra filters there only
when a match[] is present.

Range, points per series and step are bounded with 422 per the cost
limits of the metrics proposal. Times are accepted only in the two
forms the Prometheus API defines, since vmselect guesses the unit of a
numeric timestamp from its digit count. The window start picks the
short-term store when it lies within that store's retention.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 59cbf4b28e docs(observability-proxy): say what the request timeout bounds
The flag now also bounds the body read and the token and access
reviews, and 0 lifts all of those at once; an operator raising it for
slow store queries needs to know that. The store comment named a
design document the repository does not have.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:53:24 +07:00
ZverGuy d2ef5e031f docs(observability-proxy): describe the proxy as it stands
The package and serve comments described a delivery plan rather than
the code: the command named metrics it does not serve, and serve gave a
plan as the reason to refuse unknown roots before authenticating.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:53:24 +07:00
ZverGuy 4eff1617e5 fix(observability-proxy): bound the token and access reviews
Both reviews ran on the request context, which net/http cancels for a
dropped client only once the body is read. A POST whose body was still
unread therefore waited on a stalled kube-apiserver past every request
limit. The reviews now share the request timeout and answer 503 when it
passes.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:53:24 +07:00
ZverGuy f350b7ed9c test(observability-proxy): observe held slots where they cannot be missed
Polling for a slot that lives only until a 200ms deadline misses it when
the test goroutine is descheduled for longer, as under -race on a busy
runner. The tail and stalled-query tests now read the slot when the
request reaches the store, which the proxy does while holding it; the
slow-body test, which never reaches the store, gets a wider deadline.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy dff23f76e0 test(observability-proxy): spend the rate burst in a loop
Calling allowed twice in one condition reads as a duplicated expression
to staticcheck, which cannot see that each call takes a token.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy f48a94de6d fix(observability-proxy): name the logs time out of range exactly
When both bounds were out of range the answer named one of them at
random, as the check walked a map, and it printed the instant without
its fraction, so a time one nanosecond past the last one vlselect can
hold was shown as a time inside the range. The end is now checked
first and the instant is printed in full; tests pin the inclusive
bound.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy f8ff307f71 fix(observability-proxy): bound only the logs times sent to vlselect
The 1970..2262 check refused times on parsing, including a start that
the window clamps to the maximum range before anything is sent and a
since that only becomes a capped start_offset, so an old start or a
tail resume from before 1970 answered 400 where the documented answer
is to clamp. It had also detached the parseTime doc comment.

The check now applies to the times actually sent, after clamping, and
uses the range vlselect can hold, int64 nanoseconds (1677..2262); 1970
is not a limit of vlselect.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy 3722808050 test(observability-proxy): watch the slot instead of probing for it
The slow-body and stalled-client tests checked the slot by sending
requests of their own, which competed for the one slot under test: a
probe that held the slot when the request under test arrived got that
request refused, and the test failed. The tests now read the limiter's
slot count directly.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy 109980ffa7 fix(observability-proxy): refuse every empty limit the same way
An empty fields_limit answered 400, but an empty limit or facets cap
fell back to the default, so one malformed parameter got two answers
depending on its name. Every cap now refuses an empty value with 400:
a cap the client sent but left blank is a client bug, and reading it
as the default would hide it.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy 15eec1e5b1 fix(observability-proxy): refuse logs times vlselect cannot hold
The proxy sends vlselect RFC3339 times, which it never reads as a
guessed-unit number, but it accepted any RFC3339 year and unix
seconds up to 2286. vlselect keeps times as int64 nanoseconds through
time.UnixNano, which is undefined outside 1678..2262, so such a
window landed anywhere. An absolute time outside 1970..2262 now
answers 400; nothing was logged before 1970.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy 429bf5ae76 fix(observability-proxy): answer early refusals without waiting on the body
A request refused before its body was read (401, 403, 405, or a rate
or concurrency 429) had no read deadline yet, and net/http drains up
to 256 KiB of an unread body before it sends the headers. A client
that declared a body and never sent it got no answer, and held the
handler, for as long as it kept the connection; for a second form POST
arriving while the concurrency slot was taken, that was more than five
request timeouts.

The read deadline is now set when the request arrives and lifted once
the body is read, so tails are not cut. A refusal sent with the body
still unread closes the connection instead of draining it, so it is
answered at once.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy 5db02ab47e test(observability-proxy): pin the concurrency Retry-After value
The test only checked that a Retry-After was present, while the rate
limit test pins its value, so a change to the promised hint passed.
It now expects the literal value. The note on the empty fields_limit
case now gives the reason it is refused.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy 1004f2f2d8 test(observability-proxy): pin the refused forms of the bearer header
Parsing the scheme with a case-insensitive split changed which header
forms reach the token review; a bare scheme, an empty token and a
scheme run into the token must still answer 401.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy 38f9837f14 fix(observability-proxy): cap the hits groups when fields_limit is absent
The fields_limit cap applied only when the client sent the parameter.
vlselect returns every group when it is absent, as it does for 0, so
leaving it out bypassed the cap. The capped value is now always sent.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy 1ef10537f6 fix(observability-proxy): send Retry-After with the concurrency 429
Only the rate-limit 429 said when to retry. A concurrency or tail 429
came without it, so a client had no hint and could retry at once in a
loop. It now carries a one-second hint; when a slot frees depends on
the user's other requests, which the proxy cannot predict.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy 650a99ff27 fix(observability-proxy): accept the bearer scheme in any case
The authorization scheme is case-insensitive, and kube-apiserver
accepts "bearer" as well as "Bearer", so a client that works against
the API server got 401 from the proxy with the same header.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:07 +07:00
ZverGuy 95ed8134e4 fix(observability-proxy): refuse an empty fields_limit on hits
An empty fields_limit fell back to the default of 0 and reached
vlselect as fields_limit=0, instead of being refused like any other
malformed limit.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:06 +07:00
ZverGuy 7dc6ac3687 fix(observability-proxy): read a leftover request body under the deadline
ParseForm reads no body on a GET or on a POST that is not a form. When
such a request declared a body and never sent it, net/http drained it
after the handler flushed the headers, with no read deadline, so the
request held its slot for as long as the client kept the connection.

The handler now reads the rest of the body itself, under the same
deadline and size cap as the form. Draining was chosen over refusing a
declared body so that clients which send one stay working. A body
over the cap now answers 413 instead of a generic 400.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:06 +07:00
ZverGuy b1108e836a fix(observability-proxy): refuse to resolve a store before the cache syncs
An absent namespace resolves to the root store, and before the
informer's first list every namespace is absent, so a request served
in that window read a labeled namespace's logs from the wrong store.
Readiness keeps the Service from routing there, but a client that
addresses the pod directly is not stopped by it.

The resolver now fails while the cache is unsynced, which answers
503 like any other resolution error.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:06 +07:00
ZverGuy cd04c3e6c4 fix(observability-proxy): count the aligned buckets in the logs step
vlselect widens the window to step boundaries and returns a
zero-filled bucket for each one, so a start off a boundary yields one
bucket more than the span divided by the step. Sizing the step from
the unaligned span let hits and stats_query_range return MaxBuckets+1
buckets.

The minimum step now spans MaxBuckets-1 steps, and the smallest
accepted --logs-max-buckets rises to 4 so that this step still fits
the third-of-range cap that keeps alignment inside the window.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:06 +07:00
ZverGuy d3e6fd6aa8 fix(observability-proxy): keep the rate-limit buckets under their bound
When the bucket map was full and the sweep freed nothing, the new
user's bucket was added anyway, so the map grew past its bound and
every further newcomer paid a full scan under the limiter lock.

A newcomer is now refused with 429 until the first bucket refills,
and the Retry-After tells it when. Resetting the map instead would
hand every throttled user a fresh burst.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:06 +07:00
ZverGuy bb073eec1b fix(observability-proxy): do not cache reviews that failed to decide
A TokenReview whose authenticator failed comes back unauthenticated
with status.error set, and a SubjectAccessReview whose authorizer
failed comes back with an evaluation error and no decision. Both were
cached as refusals, so a valid caller stayed locked out for the cache
TTL after the outage ended.

Such answers are now refused for the current request only. A review
that failed to decide still answers 401 or 403 rather than 503: RBAC
sets an evaluation error for any binding to a missing role, which a
retryable status would turn into a permanent 503 for that user.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:06 +07:00
ZverGuy 0dc8a49c19 fix(observability-proxy): cut the connection when a log answer breaks off
Once the status line has gone out, a read error from the store left
the handler returning normally, so the chunked body ended cleanly and
the client took a partial answer for a complete one.

The handler now aborts the response in that case. The request is
counted before the abort, because the abort skips the rest of the
handler.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:06 +07:00
ZverGuy 8b8b81013c fix(observability-proxy): bound the wait for tail response headers
The tail idle timer started only once the store had sent its headers,
and a tail request carries no deadline, so a store that accepted the
request and stayed silent held the tail slot until the client left.

The timer now starts before the request, and the same timer bounds the
header wait and the gap between lines. A store that never answers
gets 504, like a non-tail request past its deadline.

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