Skip to content

fix(monitoring): preserve live prod adapter and Parakeet HPA rules - #20567

Merged
Git-on-my-level merged 9 commits into
mainfrom
fix/prod-adapter-values-drift
Oct 4, 2026
Merged

Git-on-my-level merged 9 commits into
mainfrom
fix/prod-adapter-values-drift

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

The prod adapter values omitted five live Parakeet rules. Upgrading with that file would remove metrics used by the prod Parakeet HPA, risking live STT admission. Restore all five exactly as live and retain nllb_active_requests_total for the checked-in prod NLLB chart's concurrency HPA.

The pinned prometheus-adapter 4.14.2 render preserves all 18 live rules and adds the NLLB rule (19 total). The only allowed config differences versus the 2026-10-04 read-only live capture are the two #20418 listen_track!="canary" selectors and that exact NLLB addition. Known NLLB repo-versus-live HPA drift: live prod-omi-nllb-translation consumes only Resource:cpu (1 replica, maximum 2); repo prod values set requestsPerPod: 4, which renders an External nllb_active_requests_total metric on the next deploy. An adapter rule with no matching series is harmless; retaining it protects that future deploy. This PR does not change the NLLB chart.

Deployment arguments/image and both APIService specs match live after default service port normalization. The render adds two custom-metrics RBAC objects currently absent live: ClusterRole prometheus-adapter-server-resources and ClusterRoleBinding prometheus-adapter-hpa-controller. Other rendered RBAC content and ServiceAccount match. Deployment differences are the config checksum, historical restart annotation and Kubernetes defaults; Service differences are assigned IPs/defaults. The manually created live custom APIService lacks this release's Helm ownership metadata, so the live comparator fails closed until David inspects and adopts it. No cluster writes were performed.

The runbook gives David an explicit sequence: history → capture every existing rendered object's YAML in a local gitignored directory → validate the known-good rollback baseline and reject conflicting owners → adopt unowned APIService/other objects → pinned helm upgrade --atomic → listen/Parakeet metric and HPA post-checks → rollback on failed acceptance. It explicitly checks whether both RBAC additions are still new or now exist unowned. The rollback gate requires BOTH APIService specs plus exact live rules and Deployment arguments; a missing APIService blocks adoption/upgrade. Captured APIService and ConfigMap YAML provides a documented emergency recovery alternative for an incomplete historical/atomic rollback, followed by adapter restart and repeated post-checks; this does not waive the baseline gate. The prod-operator tier has no GKE writes, so David uses his authorized human context for the write steps. Agents use ro-prod only.

The hermetic contract renders prod Parakeet, listen, pusher, VAD, diarizer, Deepgram engine/API and NLLB HPAs and checks every consumed Pods/External metric against the correct adapter rule list. The selector includes NLLB chart changes. Upgrade comparison permits only the reviewed canary/NLLB changes; rollback comparison remains exact and verifies both APIService specs before live ownership adoption.

Why isn't this a shared primitive instead? The prod values remain the shared cluster-wide rule source. This consumer/producer contract catches the observed prod-values/live incident before an incomplete Helm replacement; the comparator operates on captures without a cluster client.

Verification:

  • Local chart 4.14.2 render with the supported APIService v1 capability; fresh ro-prod captures: 18 live → 19 rendered rules, only the canary selectors and exact NLLB addition differ. Matching Deployment arguments and both APIService specs. Comparator exits 1 only for the documented custom APIService ownership HOLD.
  • python -m pytest -q backend/tests/unit/test_monitoring_adapter_hpa_contract.py: 24 passed, including NLLB HPA/selector coverage, exact NLLB query validation, missing APIService rollback rejection, pre-adoption rollback review, and existing negative drift cases.
  • Focused adapter/telemetry suites: 52 passed; selector-output test: 1 passed. PR-body validation and make preflight: 31 checks passed each. All three runbook command blocks pass bash -n; capture/adoption/recovery Python was exercised on fresh read-only captures and rejects conflicting owners or APIService service targets.
  • Helm history is unavailable to ro-prod (release secrets forbidden); David must inspect the deployed known-good manifest before any adoption/upgrade. No upgrade or post-upgrade acceptance was performed.

Failure-Class: none
Failure-Class-Reason: First observed production adapter rule-inventory drift; no existing class captures this chart/live reconciliation contract.

Draft only. Do not merge or deploy from this PR. Repeat the review using the merged revision before David performs the upgrade.

@Git-on-my-level
Git-on-my-level marked this pull request as ready for review October 4, 2026 07:39
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Git-on-my-level
Git-on-my-level merged commit c0f03bd into main Oct 4, 2026
55 checks passed
@Git-on-my-level
Git-on-my-level deleted the fix/prod-adapter-values-drift branch October 4, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant