← Back to Pull requests

feat(tagger): Add KubeAI inference tags from Model owners #59117

Closed
unknown closed this pull request without merging on Oct 29, 2026 10:21 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 14:35 UTC
Author

What does this PR do?

Add automatic low-cardinality inference_workload and inference_workload_component tags to KubeAI model pods and their containers.

  • Read the workload name from a pod owner reference with kind Model in the kubeai.org API group.

  • Set the component to inference, which matches the KubeAI serving component in the backend.

  • Preserve the owner API group in the kubelet parser, as the API server and nodefilter parsers already do.

  • Ignore model labels for this tag. A pod without a KubeAI Model owner does not get these tags.
  • Motivation

    KubeAI container metrics need the same workload and component tags as the inference workload resources. The Model owner reference gives the parent CR name even when pod labels are absent or have a different value. This follows the Dynamo tags added in #58045 and completes the Agent side of the KubeAI backend support.

    Describe how you validated your changes

  • dda inv test --race --targets=./comp/core/tagger/collectors,./comp/core/workloadmeta/collectors/util,./comp/core/workloadmeta/collectors/internal/kubelet,./pkg/util/kubernetes/kubelet passed all 9 test targets.

  • dda inv linter.go --module=test/new-e2e --targets=./tests/containers passed with no issues.

  • Release-note RST and unique-ID checks and git diff --check passed.

  • Tagger tests cover the Model owner name, conflicting labels, multiple owners, a Model from another API group, empty names, and propagation to both pods and containers.

  • Parser tests cover owner API group propagation from kubelet JSON, including core API versions and invalid versions.

  • The Kind E2E test creates a test Model CR and a separate CPU test pod with the Model controller owner set at creation. It checks the full container.cpu.usage tag set with a conflicting model label, then removes the pod, CR, and CRD. Kubelet does not refresh owner references on existing pods, so the owner must be set before the pod starts.

  • Manual GKE validation on commit b86f6e89: both Agent rollouts passed readiness checks. The live KubeAI model pod and container have both inference tags. A temporary pod with a real KubeAI Model owner and no inference labels also has both tags on its pod and container entities. The test pod was removed after validation. The demo image retains its separate custom trace-agent binary.

  • The full Kind E2E test was not run locally. The original CI run exposed the owner-update issue above; the corrected test must pass the next CI run. The Kubernetes 1.19 run also failed TestKSM: the API server rejected null lastTransitionTime and lastUpdateTime fields in DatadogMetric status before the KubeAI test started. That separate failure is not changed here.
  • Additional Notes

    Includes a release note. The existing containers E2E CI jobs cover the changed paths; no new cloud infrastructure or external images are required.

    Diff: 367 lines (+275 / -92) across 4 files Reviewer: adel121 Review duration: 1185m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.66) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.66 · 367 lines diff across 4 files
    0.66
    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.353
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.066
    Real PR Conversation Timeline
    1 comments
    "Review active on #59117"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    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: 65.9% (HIGH) · Higher = larger blast radius
    65.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: 26% · Safe to merge
    26%