← Back to Pull requests

feat(apm): add on-demand SSI for Cluster Agent #3372

Closed
unknown closed this pull request without merging on Oct 06, 2026 07:55 UTC
View on GitHub
unknown unknown commented on Aug 19, 2026 09:23 UTC
Author

Description

On-demand SSI policies are delivered over Remote Config (APM_POLICIES). The
Cluster Agent subscribes to that product when apm_config.instrumentation.on_demand
is true (Agent default), but the Operator did not expose that setting or set
DD_APM_INSTRUMENTATION_ON_DEMAND on the Cluster Agent.

This PR:

adds spec.features.apm.instrumentation.onDemand (default true, matching the Agent and Helm chart)
sets DD_APM_INSTRUMENTATION_ON_DEMAND on the Cluster Agent from that value
maps datadog.apm.instrumentation.onDemand in yaml-mapper

Unlike helm-charts#2868, Remote Configuration is already enabled on the Cluster Agent by default (features.remoteConfiguration.enabled=true). This change does not gate DD_REMOTE_CONFIGURATION_ENABLED.

With Operator defaults (APM, admission controller, Remote Config, and onDemand all true; cluster-wide SSI off), the Cluster Agent is configured for annotation- and RC-based workload selection without enabling cluster-wide injection.

Related Issue

Counterpart of https://github.com/DataDog/helm-charts/pull/2868
Follow-up to SSI on-demand RC E2E work in datadog-agent.

Type of Change

  • Bug fix

  • New feature

  • Breaking change

  • Refactor / cleanup

  • CI / tooling

  • Documentation
  • Checklist

  • Documentation updated if needed

  • Tests added or updated

  • No unintended breaking changes
  • How Has This Been Tested?

  • go test ./internal/controller/datadogagent/feature/apm/ ./internal/controller/datadogagent/defaults/ ./api/datadoghq/v2alpha1/

  • make generate && make manifests

  • make golden-update (Cluster Agent goldens now include DD_APM_INSTRUMENTATION_ON_DEMAND=true)
  • Minimum Agent Versions

    Agent: n/a
    Cluster Agent: 7.84.0+ (apm_config.instrumentation.on_demand / APM_POLICIES)

    Older Cluster Agent images ignore DD_APM_INSTRUMENTATION_ON_DEMAND.

    Additional Notes

    Default DDA install after this PR:

    DD_REMOTE_CONFIGURATION_ENABLED=true (already the Operator default)
    DD_APM_INSTRUMENTATION_ENABLED=false
    DD_APM_INSTRUMENTATION_ON_DEMAND=true

    Diff: 270 lines (+202 / -68) across 3 files Reviewer: adel121 Review duration: 69031m
    All Vouch review confidence checks passed
    Residual risk 0.16 = 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 · 270 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.335
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3372"
    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: 39.4% (MEDIUM) · Higher = larger blast radius
    39.4%
    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.6% · Safe to merge
    15.6%