← Back to Pull requests

fix: correct frontend SLO alerts with request-weighted signals #6965

Closed
unknown closed this pull request without merging on Sep 21, 2026 23:51 UTC
View on GitHub
unknown unknown commented on Sep 15, 2026 17:32 UTC
Author

ARO-29638

What

Reintroduces the Frontend (ARM RP) SLO alerts reverted in #6958, with the recording and alerting model corrected so every HTTP SLI (latency, errors, availability) is a request-weighted ratio computed directly over each MWMBR window instead of an average of a recorded 5-minute value.

Latency:

  • Replaces avg_over_time of recorded 5-minute p99 values with the request-weighted share of requests slower than 1s, computed directly over each MWMBR window from the raw histogram buckets.

  • Uses the p99 < 1s SLO's 1% latency budget:

  • - 1h/5m fast burn: more than 14.4% of requests over 1s
    - 6h/30m medium burn: more than 6% of requests over 1s
    - 3d/6h slow burn: more than 1% of requests over 1s
  • Sums HA Prometheus histogram replicas for ratio inputs. Duplicate counts cancel; selecting max independently per bucket can combine different replicas and break histogram monotonicity.
  • Errors and availability:

  • Replaces avg_over_time of the recorded 5-minute 5xx/non-5xx ratio with the 5xx (and non-5xx) request share computed directly from raw frontend_http_requests_total over each MWMBR window.

  • Thresholds, windows, severities and annotations are unchanged. Availability is the complement of the 5xx share, so its boundaries mirror the errors budget: errors 0.72% / 0.30% / 0.05%, availability 99.28% / 99.70% / 99.95%.
  • Shared:

  • Applies offset 5m to all window queries so rule evaluation avoids the unsettled ingestion edge.

  • Retains the p99/p95 and errors/availability recording rules as diagnostic metrics for dashboards, corrected to use replica summation and the same five-minute offset.

  • Regenerates the Azure Managed Prometheus alerting and recording-rule Bicep.
  • Why

    The stored Frontend p99 recording diverges from the underlying data. In West US 3 INT, the stored recording reached 13.265s while recomputing the raw histogram at the same timestamp produced 44.6ms. The stored 30m and 6h averages were 1.766s, while the settled raw-window p99 was 144ms and no requests exceeded 1s.

    There are two independent problems, and the second applies to all three HTTP SLIs:

    1. The recording rule uses max without(prometheus_replica) independently for each histogram bucket. This repeats the failure mode fixed in AROSLSRE-1746, where mixed replicas broke cumulative bucket monotonicity and reported 12.083s p99 for traffic whose actual maximum was 26ms.
    2. Averaging 5-minute values is neither an aggregate percentile nor a burn rate. It weights a quiet 5-minute window the same as a busy one. For latency, a regression test with one slow request followed by 1,000 fast requests produces an averaged p99 of 7.924s, although the aggregate p99 is 0.982s and only 0.0999% of requests exceed 1s. The same equal-weighting affects the errors and availability alerts: a brief low-traffic burst of 5xx can dominate an otherwise busy hour and trip the Sev 3 fast alert even though its share of the hour's requests is negligible.

    The new expressions measure the request fraction that consumes each SLO's error budget and calculate it directly over each alert window.

    Testing

  • Repository tooling/prometheus-rules generation and its embedded promtool tests for the RP service alerts and service recording rules.

  • Added or updated coverage for:

  • - healthy traffic and duplicate HA replicas
    - latency 14.4%, 6%, and 1% burn behavior, below-threshold traffic, five-minute delayed histogram-bucket ingestion, and request-volume skew that previously made averaged p99 misleading
    - errors and availability fast, medium, and slow burn behavior driven by raw request counters
    - a low-volume scenario proving the request-weighted 1h 5xx share stays below the fast floor while the reverted averaged-ratio design crosses it
    - corrected p99/p95 diagnostic recordings
  • yamlfmt v0.16.0 -lint on all changed YAML files.

  • git diff --check.
  • Special notes for your reviewer

    @geoberle: this addresses the stored-versus-recomputed p99 divergence and removes 5-minute averaging from the latency, errors, and availability alert models.

    @shubhadapaithankar: this preserves the intended 1h/5m, 6h/30m, and 3d/6h MWMBR structure while expressing each SLI as error-budget consumption. The errors and availability equal-weighting we discussed is fixed here; absolute-volume floors remain a possible follow-up if production shows residual low-count sensitivity.

    No dashboard or UI is changed, so screenshots are not applicable.

    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 (not applicable: no dashboard or 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
  • Diff: 642 lines (+481 / -161) across 8 files Reviewer: shubhadapaithankar Review duration: 9019m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 642 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.387
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6965"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 51.9% (MEDIUM) · Higher = larger blast radius
    51.9%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 20.5% · Safe to merge
    20.5%
    Repository