← Back to Pull requests

Layer the APM Basic SSI target on top of the selected plan #60677

Closed
unknown closed this pull request without merging on Nov 19, 2026 22:06 UTC
View on GitHub
unknown unknown commented on Nov 17, 2026 14:10 UTC
Author

<!--Please give us some feedback on your experience writing this PR ! https://app.datadoghq.com/forms/43db4c02-6837-400c-8083-692e141b1b88 !-->

What does this PR do?

Makes the APM Basic SSI target add dd-trace-c to the libraries a pod already gets, instead of replacing them.

Motivation

The Cluster Agent injects the plan of the first matching source. The APM Basic target (#58621) sits ahead of user targets and inject-all, so a pod labeled admission.datadoghq.com/apm-basic.enabled: "true" that also matches a Python target gets only dd-trace-c; the Python tracer is dropped and the pod loses its traces. APM Basic should add RED metrics next to regular APM, not replace it.

APM Basic is now resolved after the other sources and layered on top of the selected plan:

  • The selected libraries are kept; dd-trace-c, DD_INJECT_NATIVE=always and DD_APM_BASIC_ENABLED=true are added. dd-trace-c is added after language detection, and the selected target's tracer configs win on a shared name.

  • Plans that already inject dd-trace-c (GPU target, c-lib annotation) are unchanged, so their tracer is not switched to RED metrics only.

  • Denials still block APM Basic: an opt-out label, a blocking remote-config policy, or an SSI denial reached after a library annotation selected the plan. A pod matched by nothing else gets the APM Basic plan alone, as before.
  • Describe how you validated your changes

  • Unit tests for a user target, inject-all, a library annotation, a c-lib annotation, the GPU target, APM Basic alone and opt-out, plus an end-to-end MutatePod test (both init containers, env precedence, shared plan not modified).

  • minikube with a locally built Cluster Agent: a pod labeled for a Python target (trace-using-ssi: python) and APM Basic got both dd-lib-python-init and dd-lib-c-init; ddtrace emitted flask.request spans and dd-trace-c computed APM Basic stats.
  • Diff: 240 lines (+180 / -60) across 3 files Reviewer: iamluc Review duration: 3356m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 240 lines diff across 3 files
    0.39
    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.328
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #60677"
    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: 38.7% (MEDIUM) · Higher = larger blast radius
    38.7%
    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.3% · Safe to merge
    15.3%