Skip to content

fix(monitoring): disable invalid managed GKE alerts - #11093

Merged
kodjima33 merged 2 commits into
BasedHardware:mainfrom
aryanorastar:fix/9138-disable-invalid-gke-control-plane-alerts
Aug 5, 2026
Merged

kodjima33 merged 2 commits into
BasedHardware:mainfrom
aryanorastar:fix/9138-disable-invalid-gke-control-plane-alerts

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Aug 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #9138.

The production kube-prometheus-stack values enabled scrapes for kube-proxy,
kube-scheduler, and kube-controller-manager. Those control-plane targets are
managed by GKE and are not exposed to this customer cluster, so the default
*Down rules became permanently false-positive after their 15-minute window.

The production values now set those three component scrapes to enabled: false.
In kube-prometheus-stack that alone gates the corresponding PrometheusRule
groups, so the invalid pages stop without a separate defaultRules.disabled
block (which would silently keep the alerts off if the components are later
re-enabled on a self-managed control plane). Application alerts, TargetDown,
and PrometheusRuleFailures are unchanged.

Verification

  • python3 -m pytest backend/tests/unit/test_monitoring_alert_rule_contract.py backend/tests/unit/test_logging_config.py -q
  • helm template prod backend/charts/deepgram-self-hosted/nova-3/charts/kube-prometheus-stack -f backend/charts/monitoring/kube-prometheus-stack/prod_omi_monitoring_values.yaml
    • Rendered successfully; all three control-plane *Down alert rules rendered zero times.

Risk

This intentionally stops collecting these managed control-plane metrics in the
production chart. If the monitoring deployment moves to a self-managed control
plane, flip the three enabled flags (and the alerts return with them).

Invariants

No product invariants are affected.

Failure-Class: none

Review in cubic

@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.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aryanorastar — this is a genuinely useful fix. Suppressing the three managed-GKE control-plane *Down critical alerts is the right call, and the regression test in test_monitoring_alert_rule_contract.py is a nice touch that will prevent regressions. Issue #9138 is clearly addressed.

One small change request before merge.

defaultRules.disabled is redundant and slightly risky

I checked the vendored kube-prometheus-stack chart (backend/charts/deepgram-self-hosted/nova-3/charts/kube-prometheus-stack, v60.5.0). Each of the three PrometheusRule groups is gated at the file level by its component flag, e.g. in kubernetes-system-kube-proxy.yaml:

{{- if and ... .Values.defaultRules.create .Values.kubeProxy.enabled .Values.defaultRules.rules.kubeProxy }}

Setting kubeProxy.enabled: false (and likewise for kubeScheduler / kubeControllerManager) already prevents the entire KubeProxyDown / KubeSchedulerDown / KubeControllerManagerDown PrometheusRule from being rendered. So the defaultRules.disabled block doesn't suppress anything that enabled: false doesn't already suppress.

The mild risk: if the cluster ever moves to a self-managed control plane and someone flips kubeControllerManager.enabled: true (your own PR body notes these values "must be revisited" in that case), the leftover KubeControllerManagerDown: true would silently keep that alert off and could hide a real control-plane outage.

Suggested fix

Drop the defaultRules.disabled block and rely solely on the component enabled: false flags — then the alerts automatically come back when (and only when) the component is re-enabled. The test would then just assert the three enabled: false flags.

## GKE manages the Kubernetes control plane; these customer-cluster scrape
## targets do not exist and their default "down" alerts would page forever.
kubeProxy:
  enabled: false
kubeScheduler:
  enabled: false
kubeControllerManager:
  enabled: false

No blocker on the core direction — flagging for human maintainer review given this touches prod alert routing.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added needs-maintainer-review Needs a human maintainer to sign off before merge backend Backend Task (python) labels Aug 4, 2026
@aryanorastar

Copy link
Copy Markdown
Collaborator Author

@Git-on-my-level addressed — dropped the redundant defaultRules.disabled block and rely solely on kubeProxy / kubeScheduler / kubeControllerManager enabled: false.

Regression test now asserts those three flags are false and that the three *Down keys are not present under defaultRules.disabled, so re-enabling a component on a self-managed control plane restores the alert. Local contract test + pr-preflight green; helm template still renders zero of the three rules.

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct root cause (GKE-managed control plane targets never expose kube-proxy/scheduler/controller-manager), minimal chart fix, contract test added, CI green.

@kodjima33
kodjima33 merged commit ba98052 into BasedHardware:main Aug 5, 2026
29 checks passed
undivisible added a commit that referenced this pull request Aug 14, 2026
)

## Summary
- Repo-enforceable slice of
[#9587](#9587): declare
expected prod scrape targets in
`backend/charts/monitoring/expected-targets.prod.yaml`.
- Static contract tests assert values/ServiceMonitor wiring, token
scrape auth, `omi-journey-scrape-missing` coverage for enforced jobs,
Telegram receiver + `instatus_component` labels, and scrape-health
`noDataState`.
- Wire `backend/charts/monitoring/**` contract sources into unit-test
selection so inventory/values drift is caught on PRs.
- Complements [#9138](#9138)
/ [#11093](#11093) via
documented managed-GKE exclusions — does **not** duplicate control-plane
alert disables.
- Explicitly deferred: live Instatus/Telegram delivery tests,
notification-policy rework, expanding scrape-missing to
Parakeet/GPU/Stackdriver/ksm, backend-sync Cloud Run scrape path.

## Test plan
- [x] `pytest tests/unit/test_monitoring_telemetry_contract.py`
- [x] `pytest
tests/unit/test_workflow_contracts.py::test_selector_docs_and_flat_utils_do_not_force_full_suite_via_globs`
- [ ] Confirm PR CI selects the monitoring contracts when
inventory/values change
Failure-Class: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend Task (python) needs-maintainer-review Needs a human maintainer to sign off before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prod monitoring has persistent false-positive control-plane alerts and severity noise

3 participants