Commit Graph
6 Commits
Author SHA1 Message Date
ZverGuy 85fb98dd2c fix(observability-proxy): stop refusing ordinary app queries on lookback
With the lookback refusal, the 24h default turned common application
queries into 422: a day's increase, and month-long panels at the step
a dashboard picks for them. The lookback estimate is a loose upper
bound, made for the store choice, and counts every "(" as an implicit
subquery, so it far exceeds what such queries read.

The lookback is only the refusal threshold, since the lookup itself
spans the window the query reads, so its default now matches
--metrics-max-range. The chart passes it from values, so an operator
can tune it.

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 5630de4ab1 feat(observability-proxy): grant tenant viewers the metrics root
The proxy authorizes the namespace metrics root with a
SubjectAccessReview for list on cozystack.io metrics, which no role
grants yet. Aggregating it into the tenant view role reaches every
tenant group and ancestor subject without a tenant chart change.

The Deployment passes the metrics store names and short-term
retention from values, so a platform that renames or resizes its
metricsStorages can keep the proxy's store choice in step.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 03:56:18 +07:00
ZverGuy 2b6a1f4548 test(observability-proxy): drop the tenant egress policy from test notes
The chart tests named the tenant egress policy as one of the parties
the pod label and port are pinned for. That policy is gone, so the
notes now name only the Service and the console nginx, which still
depend on them.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:06 +07:00
ZverGuy 889712d244 fix(observability-proxy): grant the proxy only the API calls it makes
Nothing the proxy does reads ApplicationDefinitions, so the rule for
them is dropped. Namespaces are read through an informer, which only
lists and watches, so get is dropped as well.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-10 00:45:06 +07:00
ZverGuy 7ec648d863 feat(observability-proxy): add the chart and image build
Tenants read their logs, and later their metrics, through an
authorizing proxy that sits in front of the VictoriaLogs and
VictoriaMetrics read paths, so the proxy needs a deployable package
before the console or tenant Grafana can reach it.

The proxy reviews every token and access decision against the API
server, so its own role is limited to creating TokenReviews and
SubjectAccessReviews and reading ApplicationDefinitions and namespaces.
The namespace logs root is authorized as list on cozystack.io logs,
which no API server serves; the rule is aggregated into the tenant view
role so that a namespace viewer passes that review, as upstream grants
pods/log at view.

The image ref lands without a digest until the first build stamps it,
and the package joins the root build list so every build path refreshes
it.

Assisted-by: LLM
Signed-off-by: ZverGuy <maximbel2003@gmail.com>
2026-11-09 15:48:57 +07:00