The flag defaults test named a design document that is not in the
repository as the origin of the cost limits; the limits stand on their
own as flag defaults.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
An equal vmselect timeout still lost the race: the proxy's deadline
starts before the request reaches vmselect, so the proxy cut first
and answered 504 for a store within its time. The vmselect timeout
must now be strictly below a set request timeout, the flag help says
so, and tests pin the accepted side too, including no request timeout.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
The timeout forwarded to vmselect could be set longer than the proxy's
own request timeout. The proxy then cut a query vmselect was still
allowed to run and answered 504 for a store that was within its time.
Such a combination now stops the proxy at startup.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
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>
The store names and the short-term retention mirror metricsStorages in
the monitoring package, which an operator can rename or resize; they
are flags so the chart can follow such a change without a rebuild. The
cost limit defaults are the ones the metrics proposal settles on: 30d
range, 11000 points per series, 30s timeout.
Store names become part of a Service host name, so they are checked
as DNS labels at startup.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
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>
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>
The default of 11000 buckets was justified by a metrics proxy that
does not exist on this branch. The number is Prometheus's cap on
points per series in a range query, which the metrics root reuses.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
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>
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>
The flag parser stops at the first argument that is not a flag, so
a stray word in the container args made every flag after it fall back
to its default without an error, the root tenant included.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
NaN fails the negative check, as every comparison does, and +Inf
refills a bucket instantly, so either value switched the per-user rate
limit off while the flag looked set. Both now stop the proxy at
startup.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
Startup refuses --logs-max-buckets below 3 and --logs-max-range below
3s, but only the refusals were tested, so moving either bound up by
one went unnoticed. Pin the smallest accepted pair.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
The step is capped at a third of the maximum range so that vlselect's
alignment to whole steps cannot widen the window past that range. With
fewer than three buckets, or a range under three seconds, the minimum
step exceeds that cap and the bound no longer holds, so such settings
are refused at startup.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
Zero is the documented way to disable a limit; a negative value
disabled it too, silently. Refuse it so a typo in the chart cannot turn
off a per-user or total cap unnoticed.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
A negative duration silently disables the bound it configures, so a
typo in the chart would turn off the request deadline or the tail idle
close without any sign. Refuse it when the flags are parsed.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
The deploy unit builds an image and chart around this binary, so its
flags follow the agreed contract: listen and probe addresses, cluster
domain, root tenant and auth cache TTL, plus the logs limits. Defaults
are chosen so a stock install is safe without tuning; readiness waits
for the namespace cache because store resolution reads it on every
request. On shutdown open tails are cut after a grace period so their
clients reconnect with since to another replica.
Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>