← Back to Pull requests

fix: suppress HCPKASAvailableBurn alerts for clusters with non-empty deletionTimestamp #7237

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Sep 29, 2026 06:54 UTC
Author

What

https://redhat.atlassian.net/browse/ARO-29170: Suppress HCPKASAvailableBurn alerts for HCP clusters that are deleting with non-empty deletionTimestamp

Why

These alerts create noise for SRE on-call, consume error budget the cluster no longer "deserves", and mask the real, distinct problem. There is already a PR for handling deleting clusters here https://github.com/Azure/ARO-HCP/pull/6092#top.

Testing

  • Alert-tester: Passed (before and after showed no changes, expected behaviour since new deleting metric does not exists in prod, see jira ticket comments for detailed result.)
  • Promtool tests: Passed

  • % make -C observability/ alerts
    EXTRA_FLAGS= make -C ../tooling/prometheus-rules alerts
    go run ./...  --config-file ../../observability/alerts-sl-services.yaml 
    go run ./...  --config-file ../../observability/alerts-sl-hcps.yaml 
    go run ./...  --config-file ../../observability/alerts-sre-hcps.yaml 
    go run ./...  --config-file ../../observability/alerts-sre-services.yaml 
    go run ./...  --config-file ../../observability/alerts-rp-services.yaml 
    go run ./...  --config-file ../../observability/alerts-rp-hcps.yaml 
    go run ./...  --config-file ../../observability/alerts-msft-services.yaml 
    go run ./...  --config-file ../../observability/alerts-kusto-services.yaml 
    go run ./...  --config-file ../../observability/alerts-kusto-hcps.yaml 
    go run ./...  --config-file ../../observability/alerts-dev-services.yaml 
    go run ./...  --config-file ../../observability/alerts-dev-hcps.yaml 
    /Library/Developer/CommandLineTools/usr/bin/make fmt-devinfra
    /Library/Developer/CommandLineTools/usr/bin/make -C ../../dev-infrastructure fmt
    Running make fmt in parallel across 14 cores
    
    

    Healthy Cluster Deletion - Passed

  • HCP KAS Golden Signals - SLA BudgetBurn Rate (15m/6h) returned no data upon deleting the cluster and being stuck, stuck deleted cluster did not consume budget sla.

  • hostedClusterAPI_kubeapiserver_available SLI queries are empty when cluster became stuck, meaning, alert won't fire and won't consume error budget.

  • alert-tester: Passed The queries from the below resulted in 0 samples, meaning, no alert is expected to trigger

  • - userJourneyKubeApiserverAvailability1h5m –-for 10m: 0 series, 0 samples, no data
    - userJourneyKubeApiserverAvailability6h30m - for 30m: 0 series, 0 samples, no data
    - userJourneyKubeApiserverAvailability3d6h -for 3h: 0 series, 0 samples, no data

    Deletion signal exists. The metric is emitting, the value is 2 because there are two prometheus replica.
    Query: hostedClusterAPI_deleting{name="ecardena", deletion_timestamp!=""}
    <img width="2734" height="1814" alt="image" src="https://github.com/user-attachments/assets/6f5d9e60-670d-48c5-9b7f-16ea74fbe678" />

    The empty window means SLI output is suppressed when deletionTimestamp is set.
    <img width="2734" height="1814" alt="image" src="https://github.com/user-attachments/assets/acd4cfbf-21e7-423a-aed2-1f5561538d58" />

    Unhealthy Cluster Deletion (Zombie cluster) - Passed

    Confirming cluster is in Deleting state starting 2026-10-01t00:22:02
    % curl -sS -G "$ENDPOINT/api/v1/query_range" \
    -H "Authorization: Bearer $TOKEN" \
    --data-urlencode "query=hostedClusterAPI_deleting{${SEL}}" \
    --data-urlencode "start=$START" --data-urlencode "end=$END" --data-urlencode "step=60s" \
    | jq '{series: (.data.result|length),
    deletion_timestamp: .data.result[0].metric.deletion_timestamp,
    first_sample: (.data.result[0].values[0][0] | todate),
    last_sample: (.data.result[0].values[-1][0] | todate)}'
    {
    "deletion_timestamp": "2026-10-01t00:22:02z",
    "first_sample": "2026-10-01T00:23:00Z",
    "last_sample": "2026-10-01T01:00:00Z",
    "series": 2
    }

    <img width="1364" height="1002" alt="image" src="https://github.com/user-attachments/assets/faaa9f5b-c593-4e34-a6da-293b7d7fb02d" />

    sli_sum_5m series stopped producing data after deletion.
    <img width="1364" height="1002" alt="image" src="https://github.com/user-attachments/assets/941f623b-9884-4f8d-8504-1558bffec88a" />

    The alert expressions below return no data after deletion of zombie cluster.

    # userJourneyKubeApiserverAvailability1h5m
    (
      1 - (hostedClusterAPI_kubeapiserver_available:sli_sum_5m{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"} / hostedClusterAPI_kubeapiserver_available:sli_count_5m{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"})
      > (14.4 * (1 - 0.9995))
    )
    and on (name, namespace, _id, resource_id, cluster)
    (
      1 - (hostedClusterAPI_kubeapiserver_available:sli_sum_1h{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"} / hostedClusterAPI_kubeapiserver_available:sli_count_1h{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"})
      > (14.4 * (1 - 0.9995))
    )
    
    #userJourneyKubeApiserverAvailability6h30m
    (
      1 - (hostedClusterAPI_kubeapiserver_available:sli_sum_30m{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"} / hostedClusterAPI_kubeapiserver_available:sli_count_30m{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"})
      > (6 * (1 - 0.9995))
    )
    and on (name, namespace, _id, resource_id, cluster)
    (
      1 - (hostedClusterAPI_kubeapiserver_available:sli_sum_6h{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"} / hostedClusterAPI_kubeapiserver_available:sli_count_6h{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"})
      > (6 * (1 - 0.9995))
    )
    
    #userJourneyKubeApiserverAvailability3d6h
    (
      1 - (hostedClusterAPI_kubeapiserver_available:sli_sum_6h{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"} / hostedClusterAPI_kubeapiserver_available:sli_count_6h{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"})
      > (1 * (1 - 0.9995))
    )
    and on (name, namespace, _id, resource_id, cluster)
    (
      1 - (hostedClusterAPI_kubeapiserver_available:sli_sum_3d{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"} / hostedClusterAPI_kubeapiserver_available:sli_count_3d{name="ecardena",namespace="ocm-arohcppers-2t5k6r86gd5nibgkms2l0nopitdmuuq6"})
      > (1 * (1 - 0.9995))
    )
    

    <img width="1364" height="1002" alt="image" src="https://github.com/user-attachments/assets/65ce831c-cd93-4596-8b6c-377fa57d2fcb" />

    Special notes for your reviewer

    Detailed testing and screenshots are included in the jira ticket comments.

    PR Checklist

  • PR is scoped to a single task (no mixed concerns)

  • Title follows Conventional Commits format

  • Summary explains the "Why" behind the change

  • Linked to relevant ticket/issue

  • Screenshots included (if dashboards or other UI changes)

  • Self-reviewed the diff

  • CI/CD checks are passing (ignore Tide)

  • Draft PR used for WIP (if applicable)

  • Commit history is clean (rebased/squashed)

  • Tricky code blocks are commented

  • Specific reviewers tagged

  • All comment threads resolved before merge
  • If E2E tests are included:

  • E2E tests follow Principles of Good E2E Test Case Design

  • If new E2E use case is covered (via a new test or new check/verifier),

  • demonstrate that the test is able to detect a defect/error and fail with
    proper error message and logs which communicates nature of the problem.

    Co-authored-by: Cursor <cursoragent@cursor.com>

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: tmstff Review duration: 71038m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.59) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.59 · 650 lines diff across 8 files
    0.59
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #7237"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 59% (MEDIUM) · Higher = larger blast radius
    59%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 32.6% · Safe to merge
    32.6%
    Repository