← Back to Pull requests

feat: align monitor metric labels with HAMi and Prometheus conventions #160

Closed
unknown closed this pull request without merging on Oct 26, 2026 15:13 UTC
View on GitHub
unknown unknown commented on Sep 27, 2026 09:25 UTC
Author

What type of PR is this?

/kind feature

What this PR does / why we need it:
Aligns hami_dra_ metric labels and device names with HAMi and Prometheus conventions so dashboards can be shared with HAMi.

| Old label | New label |
| --- | --- |
| nodeid | node |
| deviceuuid | device_uuid |
| deviceidx | device_index |
| devicename | device_name |
| deviceproductname | device_type |
| devicebrand | removed |
| podnamespace | namespace |
| podname | pod |

  • Per-pod metrics (hami_dra_vgpu_) only keep node, device_uuid, namespace and pod.

  • device_type follows HAMi's names: Tesla P4 → NVIDIA-Tesla P4 (like NormalizeDeviceModel), 310P3 → Ascend310P (from the device config ConfigMap's Ascend chip table).

  • The monitor reads the device config ConfigMap via --device-config-file (default: /device-config.yaml) and falls back to built-in defaults if it's missing.

  • Legacy metrics (--legacy-metrics) keep their old names, labels and values.

  • Docs: new metrics table and a note on honor_labels.

  • Per-pod metrics aggregate claims on the same GPU, preventing duplicate-claim scrape failures; devices without a UUID are skipped.

  • Chart: monitor and webhook restart when the device config changes.

  • Docs: old-to-new label mapping table.
  • Which issue(s) this PR fixes:
    Fixes #146

    Special notes for your reviewer:

  • devicebrand is removed because device_type now includes the vendor.

  • Core ratios still use a different scale from HAMi (0–1 vs 0–100), so shared dashboards need to account for this.
  • Does this PR introduce a user-facing change?:
    The hami_dra_ metrics use new label names, devicebrand is removed, and per-pod metrics drop the device labels. Legacy metrics are unchanged.

    Related: https://github.com/Project-HAMi/HAMi/issues/2126

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

    Summary by CodeRabbit

    New Features
    Device types can be customized through a configuration file, with built-in defaults used when it is missing. Configuration changes trigger monitor and webhook pod updates.
    Prometheus metrics use normalized device types and shorter label names. Pod metrics combine allocations for the same pod and device; standard pod metrics are omitted when a device UUID is unavailable.
    Documentation
    Updated metric examples and documented legacy labels and how to preserve metric labels when they conflict with target labels.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 330 lines (+247 / -83) across 4 files Reviewer: fishman Review duration: 42108m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 330 lines diff across 4 files
    0.42
    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.347
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #160"
    general weight: 0.35
    Reviewers
    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: 42.1% (MEDIUM) · Higher = larger blast radius
    42.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: 16.6% · Safe to merge
    16.6%