Skip to content

fix(etcd-shield): raise thresholds, add total_size check, and fix severity — production - #11211

Open
peet-rh wants to merge 2 commits into
redhat-appstudio:mainfrom
peet-rh:fix/etcd-shield-alert-total-size-and-severity
Open

fix(etcd-shield): raise thresholds, add total_size check, and fix severity — production#11211
peet-rh wants to merge 2 commits into
redhat-appstudio:mainfrom
peet-rh:fix/etcd-shield-alert-total-size-and-severity

Conversation

@peet-rh

@peet-rh peet-rh commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

What

Raise etcd-shield recording rule thresholds, add etcd_mvcc_db_total_size_in_bytes (physical DB size) check, and fix alert severity — production overlay only.

Changes

Metric Activate Deactivate
in_use 80% → 85% 70% → 75%
total_size (new) 90% 80%
severity warning → critical

Why

  • Busy clusters routinely reach 75% in_use, causing unnecessary shield activation at the old 80%/70% thresholds (per staging review feedback).
  • Physical DB size (total_size) can exceed quota undetected when only in_use is checked — fragmentation fills the gap.
  • Severity fix: hysteresis branch checks ALERTS{severity="critical"} but alert was labeled warning, making the 70% deactivation threshold dead code.
  • Thresholds now match staging PR fix(etcd-shield): add total_size check and raise thresholds (staging) #11319.

Validation

Risk Assessment

Risk Level: Low — validated in staging, single revert, thresholds are more conservative than quota limits.

@openshift-ci

openshift-ci Bot commented Apr 8, 2026

Copy link
Copy Markdown

Hi @peet-rh. Thanks for your PR.

I'm waiting for a redhat-appstudio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Fix etcd-shield alert severity and add total_size metric check

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Add etcd_mvcc_db_total_size_in_bytes metric to trigger rule
  - Catches fragmentation scenarios where total size exceeds quota
  - Previously only checked in-use size, missing high-fragmentation cases
• Change alert severity from warning to critical
  - Fixes hysteresis condition that expected critical severity
  - Aligns with impact: etcd-shield denial causes cluster-wide PipelineRun rejection
• Apply changes to both base and production alert configurations
Diagram
flowchart LR
  A["etcd_shield_trigger rule"] -->|"add OR condition"| B["Check total_size_in_bytes"]
  A -->|"existing condition"| C["Check total_size_in_use_in_bytes"]
  B -->|"80% threshold"| D["Trigger alert"]
  C -->|"80% threshold"| D
  D -->|"severity update"| E["critical instead of warning"]
  E -->|"fixes hysteresis"| F["70% sticky threshold active"]
Loading

Grey Divider

File Changes

1. components/etcd-shield/base/etcd_shield_alerts.yaml 🐞 Bug fix +2/-1

Add total_size metric and fix alert severity

• Updated EtcdShieldDenyAdmission alert severity from warning to critical
• Added OR condition to etcd_shield_trigger recording rule checking
 etcd_mvcc_db_total_size_in_bytes >= 80% quota
• Preserves existing in-use size check and hysteresis logic at 70% threshold

components/etcd-shield/base/etcd_shield_alerts.yaml


2. components/etcd-shield/production/base/etcd_shield_alerts.yaml 🐞 Bug fix +2/-1

Add total_size metric and fix alert severity

• Updated EtcdShieldDenyAdmission alert severity from warning to critical
• Added OR condition to etcd_shield_trigger recording rule checking
 etcd_mvcc_db_total_size_in_bytes >= 80% quota
• Preserves existing in-use size check and hysteresis logic at 70% threshold

components/etcd-shield/production/base/etcd_shield_alerts.yaml


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Apr 8, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1)   📘 Rule violations (0)   📎 Requirement gaps (0)   🎨 UX Issues (0)
🐞\ ≡ Correctness (1)

Grey Divider


Action required

1. Hysteresis ignores total_size 🐞
Description
etcd_shield_trigger can be triggered by etcd_mvcc_db_total_size_in_bytes at the 80% threshold,
but the 70% hysteresis branch still only checks etcd_mvcc_db_total_size_in_use_in_bytes. This
makes alerts triggered by fragmentation/total-size resolve immediately when total-size drops below
80% (even if it remains between 70–80%), defeating the intended hysteresis behavior.
Code

components/etcd-shield/base/etcd_shield_alerts.yaml[R21-24]

        (((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1) or
+            ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1) or
            ((((etcd_mvcc_db_total_size_in_use_in_bytes) >= bool (etcd_server_quota_backend_bytes * 0.70)) == 1) and
                (count without (alertname, alertstate, severity)
Evidence
The recording rule adds etcd_mvcc_db_total_size_in_bytes as an 80% trigger, but the 70% ‘keep
firing’ logic remains tied only to the in-use metric. Therefore, total-size-triggered series have no
corresponding 70% stickiness condition.

components/etcd-shield/base/etcd_shield_alerts.yaml[19-29]
components/etcd-shield/production/base/etcd_shield_alerts.yaml[19-29]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The recording rule `etcd_shield_trigger` now triggers at 80% based on either `etcd_mvcc_db_total_size_in_use_in_bytes` or `etcd_mvcc_db_total_size_in_bytes`, but the 70% hysteresis (sticky) branch still only checks the in-use metric.

This causes alerts that fired due to `total_size_in_bytes` (fragmentation) to stop firing as soon as `total_size_in_bytes` falls below 80%, even if it is still above the intended 70% hysteresis threshold.

### Issue Context
You want: trigger at 80% based on either metric, and *remain active down to 70%* based on the same metric(s) that can trigger.

### Fix Focus Areas
- components/etcd-shield/base/etcd_shield_alerts.yaml[19-29]
- components/etcd-shield/production/base/etcd_shield_alerts.yaml[19-29]

### Suggested change (one of these approaches)
1) Extend the 70% hysteresis branch to OR in the `total_size_in_bytes` 70% check as well.

2) Alternatively, compute a single "effective size" (e.g., `max(etcd_mvcc_db_total_size_in_use_in_bytes, etcd_mvcc_db_total_size_in_bytes)`) and apply both the 80% and 70% thresholds to that, so trigger/hysteresis are symmetric.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@codecov

codecov Bot commented Apr 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.73%. Comparing base (8fc723d) to head (21da3b4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #11211   +/-   ##
=======================================
  Coverage   58.73%   58.73%           
=======================================
  Files          24       24           
  Lines        1546     1546           
=======================================
  Hits          908      908           
  Misses        559      559           
  Partials       79       79           
Flag Coverage Δ
go 58.73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Kustomize Render Diff

Comparing da7a01990a1c30f3b4

No render differences detected.

Comment on lines 21 to 24
(((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1) or
((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1) or
((((etcd_mvcc_db_total_size_in_use_in_bytes) >= bool (etcd_server_quota_backend_bytes * 0.70)) == 1) and
(count without (alertname, alertstate, severity)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Hysteresis ignores total_size 🐞 Bug ≡ Correctness

etcd_shield_trigger can be triggered by etcd_mvcc_db_total_size_in_bytes at the 80% threshold,
but the 70% hysteresis branch still only checks etcd_mvcc_db_total_size_in_use_in_bytes. This
makes alerts triggered by fragmentation/total-size resolve immediately when total-size drops below
80% (even if it remains between 70–80%), defeating the intended hysteresis behavior.
Agent Prompt
### Issue description
The recording rule `etcd_shield_trigger` now triggers at 80% based on either `etcd_mvcc_db_total_size_in_use_in_bytes` or `etcd_mvcc_db_total_size_in_bytes`, but the 70% hysteresis (sticky) branch still only checks the in-use metric.

This causes alerts that fired due to `total_size_in_bytes` (fragmentation) to stop firing as soon as `total_size_in_bytes` falls below 80%, even if it is still above the intended 70% hysteresis threshold.

### Issue Context
You want: trigger at 80% based on either metric, and *remain active down to 70%* based on the same metric(s) that can trigger.

### Fix Focus Areas
- components/etcd-shield/base/etcd_shield_alerts.yaml[19-29]
- components/etcd-shield/production/base/etcd_shield_alerts.yaml[19-29]

### Suggested change (one of these approaches)
1) Extend the 70% hysteresis branch to OR in the `total_size_in_bytes` 70% check as well.

2) Alternatively, compute a single "effective size" (e.g., `max(etcd_mvcc_db_total_size_in_use_in_bytes, etcd_mvcc_db_total_size_in_bytes)`) and apply both the 80% and 70% thresholds to that, so trigger/hysteresis are symmetric.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@peet-rh
peet-rh force-pushed the fix/etcd-shield-alert-total-size-and-severity branch from 3ebc4bc to 3563f40 Compare April 8, 2026 18:58
@peet-rh

peet-rh commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

/review

@qodo-code-review

qodo-code-review Bot commented Apr 8, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit c7a91af)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Logic Correctness

The updated etcd_shield_trigger expression adds a second 80% condition using etcd_mvcc_db_total_size_in_bytes. Validate the intended boolean grouping/precedence still matches the desired behavior (80% total OR 80% in-use OR (70% + already-firing gating)). A small parenthesis mistake here can change when the alert triggers.

expr: |
  (((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1) or
      ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1) or
      ((((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.70)) == 1) or
          ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.70)) == 1)) and
          (count without (alertname, alertstate, severity)
Metric Availability

Ensure etcd_mvcc_db_total_size_in_bytes is present and consistently labeled across all production clusters/etcd versions targeted by this overlay; otherwise the new branch of the OR may silently never evaluate true (or behave unexpectedly if the series is absent).

(((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1) or
    ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1) or
    ((((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.70)) == 1) or
        ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.70)) == 1)) and
Alert Severity

The EtcdShieldDenyAdmission severity changes to critical. Confirm downstream Alertmanager routing, paging policies, and any inhibition rules expect/handle this severity change to avoid unintended paging or missed notifications.

- alert: EtcdShieldDenyAdmission
  expr: etcd_shield_trigger != bool 0
  for: 2m
  keep_firing_for: 5m
  labels:
    severity: critical
  annotations:

@gcpsoares gcpsoares left a comment

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.

Review recording rule.

annotations:
summary: etcd-shield is denying admission
description: Etcd is nearing capacity limits, so etcd-shield is denying admission
- record: etcd_shield_trigger
expr: |
(((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1) or
((((etcd_mvcc_db_total_size_in_use_in_bytes) >= bool (etcd_server_quota_backend_bytes * 0.70)) == 1) and
((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1) or
((((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.70)) 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.

I'm not sure if that's ok, it might be good to test the recording rule before this merge/change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@gcpsoares — tested the recording rule against live Prometheus on stone-prd-rh01:

Current state (all 3 etcd members):

Metric Max Value % of 8 GiB quota
etcd_mvcc_db_total_size_in_bytes 3.9 GiB 49.2%
etcd_mvcc_db_total_size_in_use_in_bytes 2.9 GiB 37.1%

Condition 1in_use >= 80%: empty (correct, 37% < 80%)
Condition 2total_size >= 80%: empty (correct, 49% < 80%)
Condition 3 — hysteresis (in_use >= 70% OR total_size >= 70%) AND alert firing: returns 0 for all members (correct — neither at
70%, no alert active)

All expressions parse correctly, >= bool / == 1 semantics work as expected, and label sets match across all three metrics
(instance, job, namespace). No vector matching issues.

Severity change from warning → critical: during ITN-2026-00103, etcd-shield denying admission blocked all PipelineRuns cluster-wide —
that's critical-level impact. The change also fixes the hysteresis, which was checking ALERTS{severity="critical"} but the alert was
labeled warning, making the 70% sticky threshold dead code.

@peet-rh

peet-rh commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

/review

@qodo-code-review

Copy link
Copy Markdown

Persistent review updated to latest commit 3563f40

@peet-rh
peet-rh force-pushed the fix/etcd-shield-alert-total-size-and-severity branch 2 times, most recently from 3abd1b2 to bc33dc2 Compare April 16, 2026 01:50
@peet-rh peet-rh changed the title fix(KFLUXINFRA-3529): add total_size metric check and fix severity mi… fix(KFLUXINFRA-3529): etcd-shield total_size check + severity fix (production) Apr 16, 2026
@peet-rh
peet-rh force-pushed the fix/etcd-shield-alert-total-size-and-severity branch from bc33dc2 to c7a91af Compare April 16, 2026 02:16
@peet-rh

peet-rh commented Apr 16, 2026

Copy link
Copy Markdown
Contributor Author

/review

@qodo-code-review

Copy link
Copy Markdown

Persistent review updated to latest commit c7a91af

@jkriz-rh

Copy link
Copy Markdown

Production Approval Record

Field Value
Action APPROVED
Reviewer @jkriz-rh
Timestamp 2026-04-21T13:13:36.358Z
Risk Level low

Approved. Qodo reported issue is not an actual problem.

@jkriz-rh

jkriz-rh commented Jun 9, 2026

Copy link
Copy Markdown

Production Approval Record

Field Value
Action REVERTED TO PENDING
Reviewer @jkriz-rh
Timestamp 2026-06-09T13:24:54.304Z

@peet-rh
peet-rh force-pushed the fix/etcd-shield-alert-total-size-and-severity branch from 37b0968 to c990b30 Compare June 12, 2026 16:14
@qodo-for-redhat-appstudio

qodo-for-redhat-appstudio Bot commented Jun 12, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@peet-rh
peet-rh force-pushed the fix/etcd-shield-alert-total-size-and-severity branch from c990b30 to dc3f745 Compare June 16, 2026 16:04
@jkriz-rh

jkriz-rh commented Jul 1, 2026

Copy link
Copy Markdown

@peet-rh this PR needs at least one GitHub reviewer approval before it can be approved for production.

Please request a review from a team member using the Reviewers panel on the right, or ask someone to submit an approving review on this PR.

@peet-rh
peet-rh force-pushed the fix/etcd-shield-alert-total-size-and-severity branch from dc3f745 to a24ccf7 Compare July 9, 2026 00:36
@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: peet-rh
Once this PR has been reviewed and has the lgtm label, please assign hugares 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

@qodo-for-redhat-appstudio

Copy link
Copy Markdown

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again

Grey Divider

Qodo Logo

@peet-rh
peet-rh force-pushed the fix/etcd-shield-alert-total-size-and-severity branch 2 times, most recently from da7f64d to b03ecb4 Compare July 16, 2026 21:49
@qodo-for-redhat-appstudio

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit b03ecb4

@peet-rh
peet-rh force-pushed the fix/etcd-shield-alert-total-size-and-severity branch from b03ecb4 to ae258ad Compare July 17, 2026 05:42
@peet-rh peet-rh changed the title fix(KFLUXINFRA-3529): etcd-shield total_size check + severity fix (production) fix(etcd-shield): raise thresholds, add total_size check, and fix severity — production Jul 17, 2026
@peet-rh
peet-rh force-pushed the fix/etcd-shield-alert-total-size-and-severity branch from ae258ad to 249015c Compare July 27, 2026 20:36
@qodo-for-redhat-appstudio

qodo-for-redhat-appstudio Bot commented Jul 27, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 3 rules

Grey Divider


Action required

1. Production rings not updated ✓ Resolved 🐞 Bug ≡ Correctness
Description
This PR changes etcd_shield_trigger only in ring-0, but rd-production’s ApplicationSet deploys
etcd-shield from rings 2/3/4, so production will continue using the old in_use-only 80%/70% rule. As
a result, the new total_size check and the stated severity/threshold behavior change will not be
applied to production clusters.
Code

components/etcd-shield/rings/ring-0/base/base-snapshot/etcd_shield_alerts.yaml[R21-24]

+        (((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.85)) == 1) or
+            ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.90)) == 1) or
+            ((((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.75)) == 1) or
+                ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1)) and
Relevance

⭐⭐⭐ High

rd-production AppSet uses ring-2/3/4; team expects changes applied consistently across rings (PRs
13187, 13112).

PR-#13187
PR-#13112

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR modifies the PrometheusRule only under rings/ring-0/..., but the rd-production
ApplicationSet patch enumerates only ring-2/3/4 as the source paths for production clusters. The
ring-2/3/4 base-snapshot PrometheusRules still contain the old 0.80/0.70 in_use-only expression, so
the new total_size checks and thresholds will not be deployed to production.

components/etcd-shield/rings/ring-0/base/base-snapshot/etcd_shield_alerts.yaml[19-30]
argo-cd-apps/overlays/rd-production/patches/member-clusters-patch.yaml[4-33]
components/etcd-shield/rings/ring-2/base/base-snapshot/etcd_shield_alerts.yaml[19-28]
components/etcd-shield/rings/ring-3/base/base-snapshot/etcd_shield_alerts.yaml[19-28]
components/etcd-shield/rings/ring-4/base/base-snapshot/etcd_shield_alerts.yaml[19-28]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The updated `etcd_shield_trigger` recording rule is only present in ring-0, but production clusters deploy `components/etcd-shield/rings/ring-2`, `ring-3`, and `ring-4`. This means production will not get the new `etcd_mvcc_db_total_size_in_bytes` condition, nor the updated activation/deactivation thresholds.

### Issue Context
`rd-production` selects the rings/clusterDirs via `argo-cd-apps/overlays/rd-production/patches/member-clusters-patch.yaml`, which currently lists only ring-2/3/4. The existing ring-2/3/4 `etcd_shield_trigger` expressions still use the old `0.80/0.70` thresholds and do not reference `etcd_mvcc_db_total_size_in_bytes`.

### Fix Focus Areas
- components/etcd-shield/rings/ring-2/base/base-snapshot/etcd_shield_alerts.yaml[19-28]
- components/etcd-shield/rings/ring-3/base/base-snapshot/etcd_shield_alerts.yaml[19-28]
- components/etcd-shield/rings/ring-4/base/base-snapshot/etcd_shield_alerts.yaml[19-28]
- (optional, if severity intent is “critical” in prod) components/etcd-shield/rings/ring-2/base/prometheus-rule-severity-patch.yaml[1-3]
- (optional, if severity intent is “critical” in prod) components/etcd-shield/rings/ring-3/base/prometheus-rule-severity-patch.yaml[1-3]
- (optional, if severity intent is “critical” in prod) components/etcd-shield/rings/ring-4/base/prometheus-rule-severity-patch.yaml[1-3]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

2. All rings updated simultaneously 📘 Rule violation ☼ Reliability
Description
This change updates etcd_shield_trigger thresholds in ring-0 through ring-4 in a single PR,
effectively rolling the production behavior change to all rings at once. This violates the
requirement to scope production changes to a single ring/subset per rollout step to reduce blast
radius.
Code

components/etcd-shield/rings/ring-0/base/base-snapshot/etcd_shield_alerts.yaml[R21-24]

+        (((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.85)) == 1) or
+            ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.90)) == 1) or
+            ((((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.75)) == 1) or
+                ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1)) and
Relevance

⭐ Low

Ring-splitting suggestions repeatedly rejected (e.g., PRs #12898, #13007, #12920) despite Rule 491
wording.

PR-#12898
PR-#13007
PR-#12920

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 491 requires production rollouts to be split into rings/subsets and not applied to
all rings in a single change. The diff shows the same new thresholds/conditions being applied in all
ring-0 through ring-4 overlay files in this PR.

Rule 491: Split production rollouts into rings, never all clusters at once
components/etcd-shield/rings/ring-0/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
components/etcd-shield/rings/ring-1/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
components/etcd-shield/rings/ring-2/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
components/etcd-shield/rings/ring-3/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
components/etcd-shield/rings/ring-4/base/base-snapshot/etcd_shield_alerts.yaml[21-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Production rollout changes should be scoped to a single ring/subset per PR, but this PR updates the same alerting rule across ring-0 through ring-4.

## Issue Context
The compliance requirement is to avoid deploying production changes to all clusters/rings at once; changes should progress ring-by-ring (canary to broader rings) via separate PRs or gated stages.

## Fix Focus Areas
- components/etcd-shield/rings/ring-0/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
- components/etcd-shield/rings/ring-1/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
- components/etcd-shield/rings/ring-2/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
- components/etcd-shield/rings/ring-3/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
- components/etcd-shield/rings/ring-4/base/base-snapshot/etcd_shield_alerts.yaml[21-24]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit d728548 ⚖️ Balanced

Results up to commit c990b30


No changes from previous review

Results up to commit b03ecb4


No changes from previous review

Results up to commit 249015c ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Production rings not updated ✓ Resolved 🐞 Bug ≡ Correctness
Description
This PR changes etcd_shield_trigger only in ring-0, but rd-production’s ApplicationSet deploys
etcd-shield from rings 2/3/4, so production will continue using the old in_use-only 80%/70% rule. As
a result, the new total_size check and the stated severity/threshold behavior change will not be
applied to production clusters.
Code

components/etcd-shield/rings/ring-0/base/base-snapshot/etcd_shield_alerts.yaml[R21-24]

+        (((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.85)) == 1) or
+            ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.90)) == 1) or
+            ((((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.75)) == 1) or
+                ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1)) and
Relevance

⭐⭐⭐ High

rd-production AppSet uses ring-2/3/4; team expects changes applied consistently across rings (PRs
13187, 13112).

PR-#13187
PR-#13112

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR modifies the PrometheusRule only under rings/ring-0/..., but the rd-production
ApplicationSet patch enumerates only ring-2/3/4 as the source paths for production clusters. The
ring-2/3/4 base-snapshot PrometheusRules still contain the old 0.80/0.70 in_use-only expression, so
the new total_size checks and thresholds will not be deployed to production.

components/etcd-shield/rings/ring-0/base/base-snapshot/etcd_shield_alerts.yaml[19-30]
argo-cd-apps/overlays/rd-production/patches/member-clusters-patch.yaml[4-33]
components/etcd-shield/rings/ring-2/base/base-snapshot/etcd_shield_alerts.yaml[19-28]
components/etcd-shield/rings/ring-3/base/base-snapshot/etcd_shield_alerts.yaml[19-28]
components/etcd-shield/rings/ring-4/base/base-snapshot/etcd_shield_alerts.yaml[19-28]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The updated `etcd_shield_trigger` recording rule is only present in ring-0, but production clusters deploy `components/etcd-shield/rings/ring-2`, `ring-3`, and `ring-4`. This means production will not get the new `etcd_mvcc_db_total_size_in_bytes` condition, nor the updated activation/deactivation thresholds.

### Issue Context
`rd-production` selects the rings/clusterDirs via `argo-cd-apps/overlays/rd-production/patches/member-clusters-patch.yaml`, which currently lists only ring-2/3/4. The existing ring-2/3/4 `etcd_shield_trigger` expressions still use the old `0.80/0.70` thresholds and do not reference `etcd_mvcc_db_total_size_in_bytes`.

### Fix Focus Areas
- components/etcd-shield/rings/ring-2/base/base-snapshot/etcd_shield_alerts.yaml[19-28]
- components/etcd-shield/rings/ring-3/base/base-snapshot/etcd_shield_alerts.yaml[19-28]
- components/etcd-shield/rings/ring-4/base/base-snapshot/etcd_shield_alerts.yaml[19-28]
- (optional, if severity intent is “critical” in prod) components/etcd-shield/rings/ring-2/base/prometheus-rule-severity-patch.yaml[1-3]
- (optional, if severity intent is “critical” in prod) components/etcd-shield/rings/ring-3/base/prometheus-rule-severity-patch.yaml[1-3]
- (optional, if severity intent is “critical” in prod) components/etcd-shield/rings/ring-4/base/prometheus-rule-severity-patch.yaml[1-3]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 21da3b4 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Informational
1. All rings updated simultaneously 📘 Rule violation ☼ Reliability
Description
This change updates etcd_shield_trigger thresholds in ring-0 through ring-4 in a single PR,
effectively rolling the production behavior change to all rings at once. This violates the
requirement to scope production changes to a single ring/subset per rollout step to reduce blast
radius.
Code

components/etcd-shield/rings/ring-0/base/base-snapshot/etcd_shield_alerts.yaml[R21-24]

+        (((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.85)) == 1) or
+            ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.90)) == 1) or
+            ((((etcd_mvcc_db_total_size_in_use_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.75)) == 1) or
+                ((etcd_mvcc_db_total_size_in_bytes >= bool (etcd_server_quota_backend_bytes * 0.80)) == 1)) and
Relevance

⭐ Low

Ring-splitting suggestions repeatedly rejected (e.g., PRs #12898, #13007, #12920) despite Rule 491
wording.

PR-#12898
PR-#13007
PR-#12920

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 491 requires production rollouts to be split into rings/subsets and not applied to
all rings in a single change. The diff shows the same new thresholds/conditions being applied in all
ring-0 through ring-4 overlay files in this PR.

Rule 491: Split production rollouts into rings, never all clusters at once
components/etcd-shield/rings/ring-0/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
components/etcd-shield/rings/ring-1/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
components/etcd-shield/rings/ring-2/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
components/etcd-shield/rings/ring-3/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
components/etcd-shield/rings/ring-4/base/base-snapshot/etcd_shield_alerts.yaml[21-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Production rollout changes should be scoped to a single ring/subset per PR, but this PR updates the same alerting rule across ring-0 through ring-4.

## Issue Context
The compliance requirement is to avoid deploying production changes to all clusters/rings at once; changes should progress ring-by-ring (canary to broader rings) via separate PRs or gated stages.

## Fix Focus Areas
- components/etcd-shield/rings/ring-0/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
- components/etcd-shield/rings/ring-1/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
- components/etcd-shield/rings/ring-2/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
- components/etcd-shield/rings/ring-3/base/base-snapshot/etcd_shield_alerts.yaml[21-24]
- components/etcd-shield/rings/ring-4/base/base-snapshot/etcd_shield_alerts.yaml[21-24]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@peet-rh
peet-rh force-pushed the fix/etcd-shield-alert-total-size-and-severity branch from 249015c to 21da3b4 Compare July 27, 2026 21:42
@qodo-for-redhat-appstudio

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 21da3b4

@konflux-ci-qe-bot

konflux-ci-qe-bot commented Jul 27, 2026

Copy link
Copy Markdown

🤖 Pipeline Failure Analysis

Category: Configuration

The pipeline failed during the Konflux installation step because core ArgoCD applications were unable to sync due to missing Custom Resource Definitions (CRDs) required for their functionality.

📋 Technical Details

Immediate Cause

The Konflux installation failed because critical ArgoCD applications, including application-api-in-cluster-local, enterprise-contract-in-cluster-local, and kyverno-in-cluster-local, reported OutOfSync and Missing health statuses. These applications were unable to achieve a healthy state.

Contributing Factors

The unhealthiness of the ArgoCD applications was directly attributable to the absence of essential Kubernetes Custom Resource Definitions (CRDs), such as applications.appstudio.redhat.com, componentdetectionqueries.appstudio.redhat.com, enterprisecontractpolicies.appstudio.redhat.com, and cleanuppolicies.kyverno.io. This indicates a failure in the initial deployment or a dependency not providing these foundational resources.

Impact

The inability to successfully install Konflux rendered the entire AppStudio E2E test environment unusable, preventing any subsequent tests from executing and leading to the overall pipeline failure.

🔍 Evidence

appstudio-e2e-tests/konflux-ci-install-konflux

Category: configuration
Root Cause: The Konflux installation failed because multiple core ArgoCD applications were unable to sync and achieve a healthy state. This was primarily due to missing Custom Resource Definitions (CRDs) and other essential Kubernetes resources required by these applications, indicating a failure in their deployment or a dependency issue.

Logs:

artifacts/appstudio-e2e-tests/konflux-ci-install-konflux/build-log.txt
[2026-07-28 04:10:23] [STEP] Waiting for all ArgoCD applications to sync and become healthy
artifacts/appstudio-e2e-tests/konflux-ci-install-konflux/build-log.txt
[2026-07-28 04:12:30] [PROGRESS] Applications: 28/44 ready | 16 pending (2m 7s elapsed)
artifacts/appstudio-e2e-tests/konflux-ci-install-konflux/build-log.txt
[2026-07-28 04:12:30] [SUBSTEP] Detailed status of pending applications:
[2026-07-28 04:12:31] [INFO]   ├─ App: application-api-in-cluster-local
[2026-07-28 04:12:31] [INFO]   │  ├─ Sync Status: OutOfSync
[2026-07-28 04:12:31] [INFO]   │  ├─ Health Status: Missing
[2026-07-28 04:12:31] [INFO]   │  ├─ Out-of-sync resources: 11
[2026-07-28 04:12:31] [WARN]   │  ├─ Degraded/Missing resources:
[2026-07-28 04:12:31] [WARN]   │  │  └─ CustomResourceDefinition/applications.appstudio.redhat.com: Missing
[2026-07-28 04:12:31] [WARN]   │  │  └─ CustomResourceDefinition/componentdetectionqueries.appstudio.redhat.com: Missing
[2026-07-28 04:12:31] [WARN]   │  │  └─ CustomResourceDefinition/components.appstudio.redhat.com: Missing
artifacts/appstudio-e2e-tests/konflux-ci-install-konflux/build-log.txt
[2026-07-28 04:12:32] [INFO]   ├─ App: enterprise-contract-in-cluster-local
[2026-07-28 04:12:32] [INFO]   │  ├─ Sync Status: OutOfSync
[2026-07-28 04:12:32] [INFO]   │  ├─ Health Status: Missing
[2026-07-28 04:12:32] [INFO]   │  ├─ Out-of-sync resources: 1
[2026-07-28 04:12:32] [WARN]   │  ├─ Degraded/Missing resources:
[2026-07-28 04:12:32] [WARN]   │  │  └─ CustomResourceDefinition/enterprisecontractpolicies.appstudio.redhat.com: Missing
artifacts/appstudio-e2e-tests/konflux-ci-install-konflux/build-log.txt
[2026-07-28 04:12:35] [INFO]   ├─ App: kyverno-in-cluster-local
[2026-07-28 04:12:35] [INFO]   │  ├─ Sync Status: OutOfSync
[2026-07-28 04:12:35] [INFO]   │  ├─ Health Status: Missing
[2026-07-28 04:12:35] [INFO]   │  ├─ Out-of-sync resources: 31
[2026-07-28 04:12:35] [WARN]   │  ├─ Degraded/Missing resources:
[2026-07-28 04:12:35] [WARN]   │  │  └─ CustomResourceDefinition/cleanuppolicies.kyverno.io: Missing
[2026-07-28 04:12:35] [WARN]   │  │  └─ CustomResourceDefinition/clustercleanuppolicies.kyverno.io: Missing

Analysis powered by prow-failure-analysis | Build: 2081951185706684416

@qodo-for-redhat-appstudio

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit d728548

@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown

@peet-rh: 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/appstudio-e2e-tests d728548 link true /test appstudio-e2e-tests

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants