[CONTP-2162] Standardize reconcile log fields across controllers #3713
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 491 lines diff across 6 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.371
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3713"
general
weight: 0.35
khewonc
What does this PR do?
Standardizes reconcile logs for DatadogAgent, DatadogAgentInternal, DatadogGenericResource, DatadogMonitor, DatadogDashboard, DatadogSLO, and DatadogAgentProfile on flat
namespace/namefields and thecontrollers.<Kind>logger name. A shared log constructor applies the same format to controller-runtime messages, includingReconciler error, and reconciler code uses the context logger to retainreconcileID.Removes redundant identity fields and the encoder's special case for the nested DDAI field. Adds registered-controller coverage for identity, logger names, duplicate fields, and reconcile correlation.
Motivation
CONTP-2162. CONTP-2142 already removed the DDA duplication and established flat identity fields. This completes the remaining consistency work for the other controllers listed in the ticket.
Additional Notes
Log query compatibility: queries using
datadogmonitor.,datadogdashboard.,datadogslo.,datadogagentprofile., nested kind objects, orMonitor Namespace/Monitor Namemust migrate to flatnamespace/name, scoped bylogger. DDA and GenericResource already use flat identity fields.Controller metadata remains available to custom loggers. The default encoder continues to suppress
controller,controllerGroup, andcontrollerKind. Custom loggers that previously exposed the nestedDatadogAgentInternalfield now use the flat fields too.Release note: Reconcile logs for the seven controllers above now consistently identify resources with flat
namespaceandnameattributes and usecontrollers.<Kind>logger names on both reconciler and controller-runtime messages. Update queries using the removed resource-specific identity attributes.Minimum Agent Versions
No new minimum Agent or Cluster Agent version requirements.
Describe your test plan
Across 144 JSON log entries:
DDA, DDAI, Monitor, and GenericResource consistently use controllers.<Kind>, flat namespace/name, and reconcileID.
No duplicate keys or legacy identity fields.
Each reconcile ID maps to one consistent resource identity.
Successful Monitor creation logs also match. No warnings or errors appeared.
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel[1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
[CONTP-2162]: https://datadoghq.atlassian.net/browse/CONTP-2162?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ