Repository navigation
feat(monitoring): add optional PodMonitor and metrics policy - #1
Draft
cooktheryan wants to merge 7 commits into
Draft
cooktheryan wants to merge 7 commits into
cooktheryan wants to merge 7 commits into
Conversation
cooktheryan
force-pushed
the
feat/issue-1302-rollout-operator
branch
3 times, most recently
from
November 4, 2026 20:35
6a11771 to
0dd3490
Compare
cooktheryan
force-pushed
the
issue-23-monitoring
branch
7 times, most recently
from
November 11, 2026 19:53
92569c3 to
ebb2d68
Compare
cooktheryan
force-pushed
the
issue-23-monitoring
branch
from
November 12, 2026 15:21
fe9b2d8 to
a31eb11
Compare
Monitoring is opt-in through PRAXIS_MONITORING_ENABLED. When enabled, each managed data plane gets a PodMonitor scraping the reserved admin port and a NetworkPolicy that admits metrics traffic only from the configured Prometheus namespace and pods; data ports stay open to every peer. When disabled, or when no usable listeners remain, owned monitoring resources are removed, and reconciliation tolerates an absent Prometheus Operator CRD. Health, readiness, and metrics move to a reserved admin port (9902) served through the data plane's admin.metrics_address, so probes and scrapes no longer need public admin access. Gateway listeners asking for that port report PortUnavailable without blocking other listeners. The metrics contract requires the praxis 0.7.5 data plane, whose stricter validation rejects several shapes this operator previously generated, so config generation follows it: - Routeless listeners terminate with a 404 static response instead of an empty router chain, and terminating filters from redirect and invalid-reference rules keep answering ahead of that fallback. - Terminating filters run only on the listeners their routes target, so a filter from one listener never answers another listener's traffic or overrides its routeless 404 fallback. - Cluster names use only the characters the data plane accepts. - Backends without ready endpoints answer 500 instead of blocking rollout, weight-0 backendRefs contribute no endpoints, duplicate addresses merge with summed weights, and endpoint weights scale into the supported 1..=1000 range. Signed-off-by: Ryan Cook <rcook@redhat.com>
cooktheryan
force-pushed
the
issue-23-monitoring
branch
from
November 12, 2026 17:46
e48d97a to
722eadf
Compare
Terminating filters now carry the section names of the route that produced them, and a listener chain only gets the filters whose route targets it. A catch-all redirect or invalid-reference 500 on one listener can no longer answer another listener's traffic or override its routeless 404 fallback. Add coverage for cross-listener scoping and mixed listeners. Signed-off-by: Ryan Cook <rcook@redhat.com>
Signed-off-by: Ryan Cook <rcook@redhat.com> # Conflicts: # Cargo.lock
An HTTPRoute backendRef with an unsupported group or kind is unresolvable, so the rule must answer the Gateway API 500 instead of emitting a route to a cluster that never resolves. Treat unsupported kinds as not servable in both route generation and filter conversion, and add a regression test for the conformance case. Signed-off-by: Ryan Cook <rcook@redhat.com>
cooktheryan
force-pushed
the
issue-23-monitoring
branch
from
November 13, 2026 19:32
404650e to
04e3025
Compare
cooktheryan
force-pushed
the
feat/issue-1302-rollout-operator
branch
from
November 13, 2026 19:32
01a8cf5 to
cc2f02b
Compare
Rejected rules no longer contribute filters, so a POST-only redirect on a routeless listener cannot answer GET requests after validation drops the route. A chain that already ends in an unconditional static response is truncated there instead of appending a 404 the data plane would reject as unreachable. Add regression tests for both cases. Signed-off-by: Ryan Cook <rcook@redhat.com>
The unless clauses in a filter's conditions name the sibling rules that outrank it. Converting one RouteFilters for the whole Gateway let a higher-priority rule on one listener suppress another listener's 500 or redirect. Build a RouteFilters per listener from only the routes that listener targets, and use it when assembling that chain. Add a regression test where an /api rule on the api listener must not affect a catch-all response on web. Signed-off-by: Ryan Cook <rcook@redhat.com>
A weight-0 backendRef is resolvable but must receive no traffic. It was still claiming the cluster dedup identity for single-backend rules, so a later positive-weight ref for the same Service was dropped and the cluster could end up endpointless. Treat weight-0 refs as not servable, which keeps them out of the cluster name and dedup set, and have such a rule answer 500 like any other rule with no usable backend. Signed-off-by: Ryan Cook <rcook@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes praxis-proxy#23
Configuration
Set
PRAXIS_MONITORING_ENABLED=trueto enable the resources. The monitoring namespace and Prometheus pod label selector are configurable withPRAXIS_MONITORING_NAMESPACEandPRAXIS_MONITORING_POD_SELECTOR.This PR targets the rollout-contract branch from PR praxis-proxy#24 so the diff is limited to the monitoring follow-up; merge it after that branch lands or retarget it to main once the 9902 metrics contract is available there.
Validation
cargo +nightly fmt --checkon changed Rust filescargo clippy -p praxis-operator --all-targets -- -D warningscargo test -p praxis-operator --lib— 477 passedgit diff --checkThe generated NetworkPolicy intentionally does not restrict the data listener. Clusters whose CNI applies policy to node-originated kubelet probes need a separate node-CIDR allowance.