← Back to Pull requests

CARRY: RHAI-23206: Add per-RayCluster PodMonitor controller #260

Closed
unknown closed this pull request without merging on Nov 24, 2026 12:38 UTC
View on GitHub
unknown unknown commented on Nov 18, 2026 14:08 UTC
Author

Why are these changes needed?

Automatically configure Ray metrics collection by creating one owned PodMonitor per eligible RayCluster, including RayJob- and RayService-created clusters.

The controller selects head and worker pods through the named metrics port, adds identifying labels, and supports workload opt-out, drift correction, and cleanup when disabled. Foreign PodMonitors are preserved, and monitoring failures do not block workloads.

Enabled through the OpenShift overlay with minimal RBAC. UWM NetworkPolicy ingress is tracked separately in RHAI-23207.

flowchart TD
    A[User creates RayJob or RayCluster] --> B[Ray head and workers expose metrics]
    A --> C["This implementation: create owned PodMonitor"]
    C --> D[Prometheus Operator configures UWM]
    D --> E[UWM Prometheus]
    E -->|HTTP scrape — requires network access| B
    E -->|Stored metrics available to| F[Thanos queries and dashboards]
    style C fill:#d9ead3,stroke:#38761d,color:#000

Related issue number

RHAI-23206

Labels

  • If this PR has user-facing changes that require documentation updates at release time, I have added the doc-updates-required label.

  • If this PR contains breaking changes, I have added the breaking-change label.
  • Checks

  • I've made sure the tests are passing.

  • Testing Strategy

  • - [x] Unit tests
    - [ ] Manual tests
    - [ ] This PR is not tested :(

    Focused PodMonitor tests, operator lint, and Helm/OpenShift rendering checks passed.

    Architecture

  • This PR does not change component boundaries or API contracts

  • OR: I have updated the relevant design doc / DEVELOPMENT.md
  • Live OpenShift scraping, webhook behavior, and upgrade validation remain unverified.

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Added optional PodMonitor-based metrics scraping for RayCluster head and worker Pods, including clusters created by RayJobs.
    Monitoring is controlled by a feature gate and respects cluster and RayJob opt-outs. When disabled, the operator cleans up monitors it owns.
    Monitoring setup and API availability issues do not block RayCluster reconciliation; failures are retried and reported as warning events.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 304 lines (+228 / -76) across 3 files Reviewer: abhijeet-dhumal Review duration: 8550m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 304 lines diff across 3 files
    0.40
    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.342
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #260"
    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: 40.1% (MEDIUM) · Higher = larger blast radius
    40.1%
    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: 15.9% · Safe to merge
    15.9%