← Back to Pull requests

KEP-5915: Trace Context Propagation and Distributed Tracing for Controllers #6505

Open
unknown opened this pull request with 254 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 10, 2026 23:29 UTC
Author

Description

This PR proposes KEP-5915: Trace Context Propagation and Distributed Tracing for Controllers under SIG Instrumentation (superseding #5916, co-authored with @artem-tkachuk).

It defines a standard convention (tracing.k8s.io/ annotations mapped dynamically from the installed OpenTelemetry TextMapPropagator), an out-of-tree mutating admission webhook sub-project under sig-instrumentation for atomic context injection on desired-state mutations, and in-tree helpers in k8s.io/component-base/tracing (ObjectCarrier, WithObjects, LinkTracker, and link-aware sampling) to connect asynchronous controller reconciliation loops across object boundaries via OpenTelemetry Span Links (SpanKindInternal).

  • One-line enhancement description: Enable distributed trace context propagation across Kubernetes objects via tracing.k8s.io/ annotations, an out-of-tree mutating admission webhook sub-project under sig-instrumentation, and Span Link extraction helpers in k8s.io/component-base/tracing, with alpha instrumentation for the Deployment and ReplicaSet controllers in kube-controller-manager.

  • Kubernetes Enhancement Proposal: https://github.com/kubernetes/enhancements/issues/5915

  • Target Stage: alpha (v1.39), stage: implementable

  • Participating SIGs: sig-instrumentation (owning), sig-api-machinery, sig-apps
  • Prototype Diffs

  • In-Tree kubernetes/kubernetes Prototype (k8s.io/apiserver, k8s.io/component-base/tracing, kube-controller-manager, Deployment & ReplicaSet controllers):

  • https://github.com/kubernetes/kubernetes/compare/master...dashpole:kubernetes:async-controller-tracing
  • Out-of-Tree tracing-admission-webhook Prototype (sig-instrumentation sub-project):

  • - Diff: https://github.com/dashpole/kubernetes/compare/tracing-admission-webhook-base...tracing-admission-webhook-prototype
    - Tree: https://github.com/dashpole/kubernetes/tree/tracing-admission-webhook-prototype

    /sig instrumentation api-machinery apps

    Diff: 254 lines (+190 / -64) across 3 files Reviewer: RaphSku Review duration: 34989m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.39) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 254 lines diff across 3 files
    0.39
    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%
    42%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.332
    Real PR Conversation Timeline
    1 comments
    "Review active on #6505"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% 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: 39.1% (MEDIUM) · Higher = larger blast radius
    39.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: 43.0% · Lower = rushed or shallow review
    43.0%
    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: 22.3% · Safe to merge
    22.3%