fix(usm): prepend `service_monitoring_config` via heredoc #431
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.69) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.69 · 459 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.367
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.069
Real PR Conversation Timeline
1 comments
"Review active on #431"
general
weight: 0.35
arbll
What does this PR do?
Rewrites
update_usmto strictly mirrorupdate_ddot(below in the same file): guard withgrep -q "^<key>:", on miss prepend a fresh<key>:\n enabled: trueblock via heredoc, on hit log a "configuration already exists" notice and skip.Same structure, same
printfphrasing, same idempotency guarantee.Motivation
The previous implementation enabled USM by editing the agent-shipped
system-probe.yaml.examplein place withsed:The second
seduses the address range/^service_monitoring_config:/through/^$/(header to next blank line).DataDog/datadog-agent#48567 (merged 2026-04-01, milestone 7.79.0) inserted a blank line directly after every top-level key in
pkg/config/system-probe_template.yaml, including# service_monitoring_config:.After 7.79.0 was published on 2026-05-20 the range collapsed to a single line and the
enabled: false->enabled: truesubstitution silently stopped firing.Customer impact: anyone curling
install_script_agent7.shwithDD_SYSTEM_PROBE_SERVICE_MONITORING_ENABLED=trueagainst a 7.79.0+ agent ends up with USM disabled despite asking for it.CI impact: DataDog/datadog-agent
test_install_scriptis red on every build that runs it post-2026-05-20: 18 consecutive failures on main (since 20:11 UTC; last green at 04:13 UTC same day), 4 on 7.80.0-rc.3 (since 2026-05-22), 3 on 7.79.1-rc.1 (since 2026-05-26).Both RC tags are blocked from shipping.
Describe how you validated your changes
install_script_agent7.shvia make and confirmed the heredoc-with-guard form is emitted at the expected line, byte-for- byte parallel toupdate_ddot's first block,TestInstallUSMSuite's assertion onservice_monitoring_config.enabled == truecontinues to hold, independently of the template's layout,pkg/config/system-probe_template.yamlships# service_monitoring_config:commented out on both main and the 7.79.0 tag, sogrep -q "^service_monitoring_config:"isfalseon a fresh stock install andtrueon a re-run against our own prepended output.Additional Notes
sed: on a re-run against a customer's already-uncommentedservice_monitoring_config:block, the old code would force-flip a commented# enabled: falseinside that block toenabled: true; the new code skips outright. Aligns withupdate_ddot's "leave existing top-level keys alone" policy.set_privileged_logsandset_discovery(aboveupdate_usm) share the duplicate-key footgun this PR closes forupdate_usm; fixing them is out of scope here but worth a follow-up.shunit2unit test exercisingupdate_usmwould catch this class of regression earlier; out of scope for this hotfix.install-scripte2e suite (2026-05-20).test_install_scriptjob triggers the child pipeline with--git-ref main, so CI there will turn green immediately after merge.