Skip to content

ROSAENG-14114: New alert detecting when a MC cluster cannot send metrics to RHOBS or telemeter#2806

Open
Nikokolas3270 wants to merge 1 commit into
openshift:masterfrom
Nikokolas3270:ROSAENG-14114
Open

ROSAENG-14114: New alert detecting when a MC cluster cannot send metrics to RHOBS or telemeter#2806
Nikokolas3270 wants to merge 1 commit into
openshift:masterfrom
Nikokolas3270:ROSAENG-14114

Conversation

@Nikokolas3270

@Nikokolas3270 Nikokolas3270 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

feature

What this PR does / why we need it?

This PR makes sure we (SREP) are alerted in case metrics cannot be remote written to RHOBS or telemeter.
It is important to be alerted as all Hypershift alerts but also the hosted cluster billing is based on those metrics

Which Jira/Github issue(s) this PR fixes?

_Fixes ROSAENG-14114

Special notes for your reviewer:

We may want to increase the severity of the other alerts from warning to critical.
As said being able to send metrics to RHOBS & telemeter is crucial for all Hypershift alerting & billing based on the metrics sent there.

Pre-checks (if applicable):

  • Tested latest changes against a cluster
  • Included documentation changes with PR
  • Not a FedRamp change

Summary by CodeRabbit

  • New Features

    • Added monitoring access and new scrape configurations for RHOBS and hypershift Prometheus endpoints.
    • Introduced updated critical alerts covering missing, degraded, and remote-write failure conditions.
  • Bug Fixes

    • Updated health checks to evaluate deployment status in the correct namespace.
    • Reworked hypershift degraded detection to better catch readiness gaps, restart-loop behavior, and remote-write failure ratios.
    • Refined alert text and guidance for clearer notifications.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 7, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 7, 2026

Copy link
Copy Markdown

@Nikokolas3270: This pull request references ROSAENG-14114 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

What type of PR is this?

feature

What this PR does / why we need it?

This PR makes sure we (SREP) are alerted in case metrics cannot be remote written to RHOBS or telemeter.
It is important to be alerted as all Hypershift alerts but also the hosted cluster billing is based on those metrics

Which Jira/Github issue(s) this PR fixes?

_Fixes ROSAENG-14114

Special notes for your reviewer:

We may want to increase the severity of the other alerts from warning to critical.
As said being able to send metrics to RHOBS & telemeter is crucial for all Hypershift alerting & billing based on the metrics sent there.

Pre-checks (if applicable):

  • Tested latest changes against a cluster
  • Included documentation changes with PR
  • Not a FedRamp change

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Nikokolas3270
Once this PR has been reviewed and has the lgtm label, please assign reedcort for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot requested review from dakotalongRH and reedcort July 7, 2026 16:16
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 27c28b4e-2153-402e-8e32-580b00df034c

📥 Commits

Reviewing files that changed from the base of the PR and between 3101d43 and 0c2d97c.

⛔ Files ignored due to path filters (3)
  • hack/00-osd-managed-cluster-config-integration.yaml.tmpl is excluded by !hack/**
  • hack/00-osd-managed-cluster-config-production.yaml.tmpl is excluded by !hack/**
  • hack/00-osd-managed-cluster-config-stage.yaml.tmpl is excluded by !hack/**
📒 Files selected for processing (1)
  • deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml

Walkthrough

Updates the management-cluster monitoring manifest with Prometheus access and scrape targets, then replaces stack and workload alert rules with COO-specific missing, degraded, restart, and remote-write alerts.

Changes

Management-cluster OBO monitoring

Layer / File(s) Summary
Access and scrape setup
deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml
Adds a RoleBinding for prometheus-k8s and two ServiceMonitor resources that scrape the monitoring endpoints over TLS with remote-metric filtering.
Stack alert rules
deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml
Replaces the stack PrometheusRule group and updates missing and degraded deployment alerts for the COO stack.
Workload missing and readiness alerts
deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml
Adds missing-statefulset alerts and readiness-gap alerts for hypershift monitoring workloads.
Workload restart and remote-write alerts
deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml
Adds restart-loop alerts and remote-write failure ratio alerts for workload monitoring.

Estimated code review effort: 4 (Complex) | ~45 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: a new alert for managed-cluster metric delivery failures to RHOBS or Telemeter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Only YAML/templates changed; no It/Describe/Context/When titles or dynamic test-name patterns were found in the modified files.
Test Structure And Quality ✅ Passed No Ginkgo test code was changed in this PR; the diff only touches YAML manifests/templates, so the test-structure review is not applicable.
Microshift Test Compatibility ✅ Passed The PR only changes YAML monitoring manifests and templates; no new Ginkgo It/Describe/Context tests were added.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Only YAML/templates changed; no new Ginkgo e2e tests or SNO-sensitive test logic were added.
Topology-Aware Scheduling Compatibility ✅ Passed The manifest only adds RBAC, ServiceMonitors, and alert rules; it contains no scheduling fields, replica logic, anti-affinity, or node/topology selectors.
Ote Binary Stdout Contract ✅ Passed PR only changes YAML/template manifests; no OTE binary process-level code (main/init/TestMain/suite setup) was modified.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only YAML/manifests changed; no new Ginkgo tests, IP parsing, or external-network code was added.
No-Weak-Crypto ✅ Passed PASS: The PR only adds Prometheus alerts/ServiceMonitors; the changed manifest contains no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed PASS: The changed manifests add RBAC, ServiceMonitors, and PrometheusRule only; diff search found no privileged/hostNetwork/hostPID/allowPrivilegeEscalation/root settings.
No-Sensitive-Data-In-Logs ✅ Passed No new logging statements or secret values were added; the changes are Prometheus alert/config YAML only.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@Nikokolas3270 Nikokolas3270 marked this pull request as draft July 7, 2026 16:22
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 7, 2026
@Nikokolas3270 Nikokolas3270 marked this pull request as ready for review July 8, 2026 07:52
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 8, 2026
@openshift-ci openshift-ci Bot requested review from Tafhim and rogbas July 8, 2026 07:52

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml (1)

115-137: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Distinguish the three COOWorkloadDegradedSRE alerts.

The same alert name COOWorkloadDegradedSRE is reused for three unrelated conditions (readiness gap, restart loop, remote-write failure), all pointing to a single SOP. Prometheus permits duplicate names, but on-call SREs seeing this alert fire cannot tell which failure mode occurred without inspecting the cause label, and Alertmanager grouping by alertname will mix them. Consider giving each a distinct name (e.g. COOWorkloadNotReadySRE, COOWorkloadRestartLoopSRE, COOWorkloadRemoteWriteFailingSRE) and matching SOP links.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml` around
lines 115 - 137, The three COOWorkloadDegradedSRE entries in the alert rules are
conflating different failure modes under one alertname, which makes alert
routing and on-call triage ambiguous. Update each alert block in the Prometheus
rules to use a distinct alert name tied to its specific condition (the readiness
check, the restart-loop check, and the remote-write failure check) and keep the
existing annotations/cause labels aligned with each new name. Use the
COOWorkloadDegradedSRE alert blocks in this rules file as the place to split
them apart so Alertmanager grouping and SOP references clearly identify the
exact problem.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml`:
- Around line 126-135: The alert text for COOWorkloadDegradedSRE is inconsistent
with the rule timing: the annotation in the monitoring alert uses a different
duration than the `for` value in the same rule. Update the `description` in the
COOWorkloadDegradedSRE alert so it matches the actual `for: 30m` behavior, and
keep the wording aligned with the `expr`/`for` settings in the alert definition
to avoid confusion.
- Around line 137-148: The COOWorkloadDegradedSRE alert expression is using the
wrong denominator and threshold, so it fires far too early. Update the PromQL in
the COOWorkloadDegradedSRE rule to calculate failure percentage using
prometheus_remote_storage_samples_failed_total divided by failed plus total, and
compare it against the intended 10% threshold. Keep the alert name, labels, and
annotations unchanged; only fix the expression inside the alert definition.

---

Nitpick comments:
In `@deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml`:
- Around line 115-137: The three COOWorkloadDegradedSRE entries in the alert
rules are conflating different failure modes under one alertname, which makes
alert routing and on-call triage ambiguous. Update each alert block in the
Prometheus rules to use a distinct alert name tied to its specific condition
(the readiness check, the restart-loop check, and the remote-write failure
check) and keep the existing annotations/cause labels aligned with each new
name. Use the COOWorkloadDegradedSRE alert blocks in this rules file as the
place to split them apart so Alertmanager grouping and SOP references clearly
identify the exact problem.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: affb1a89-66e0-419c-b735-5e843495191c

📥 Commits

Reviewing files that changed from the base of the PR and between 205ab87 and 3101d43.

⛔ Files ignored due to path filters (3)
  • hack/00-osd-managed-cluster-config-integration.yaml.tmpl is excluded by !hack/**
  • hack/00-osd-managed-cluster-config-production.yaml.tmpl is excluded by !hack/**
  • hack/00-osd-managed-cluster-config-stage.yaml.tmpl is excluded by !hack/**
📒 Files selected for processing (1)
  • deploy/sre-prometheus/management-cluster/100-obo-stack-monitoring.yml

@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@Nikokolas3270: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/pr-check 0c2d97c link true /test pr-check

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

namespace: openshift-observability-operator
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we really need a bearer token + TLS config? I assume that the metrics endpoint is plain HTTP without authentication.

prometheus: sre-coo-stack
role: alert-rules
name: sre-obo-stack
name: sre-coo-stack

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

noob question but will the old sre-obo-stack resource be deleted?

- name: sre-coo-stack
rules:
- alert: OpenshiftObservabilityOperatorStackDownSRE
- alert: COOStackMissingSRE

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(nit) probably a follow-up but I would recommend 1 rule per resource which would provide more targeted alerts.

absent(kube_deployment_status_replicas{deployment="observability-operator", namespace="openshift-observability-operator"}) or
absent(kube_statefulset_status_replicas{statefulset="prometheus-hypershift-monitoring-stack", namespace="openshift-observability-operator"}) or
absent(kube_statefulset_status_replicas{statefulset="alertmanager-hypershift-monitoring-stack", namespace="openshift-observability-operator"})
absent(kube_deployment_status_replicas{deployment="obo-prometheus-operator", namespace="openshift-operators"}) or

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

namespace="openshift-operators" or namespace="openshift-observability-operator"?

SOP: https://github.com/openshift/ops-sop/blob/master/hypershift/alerts/OpenshiftObservabilityOperatorAlertmanagerComponentsDegradedSRE.md
summary: "Some pods in the 'openshift-observability-operator' namespace cannot remote write to telemeter or RHOBS"
description: |
{{ $value | printf "%.2f" }}% of the time series cannot be be sent to {{$labels.url}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

or humanizePercentage without multiplying by 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants