[CONTP-2222] Add operator user agent to Datadog API clients #3658
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 · 242 lines diff across 3 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.329
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3658"
general
weight: 0.35
wdhif
What does this PR do?
Set
User-Agent: datadog-operator/<version>on Datadog API requests from all resource controllers, metrics/events forwarding, and credential validation. Centralize client construction indatadogclient.NewAPIClient.Motivation
Identify requests from the Datadog Operator and their originating version, following the cluster-agent user-agent naming convention.
Additional Notes
The existing build version is used unchanged. Make-based untagged local and nightly builds use the short Git commit; tagged builds use the release tag. Direct
go build/go runwithout linker flags retains the existing0.0.0default.Commit hashes and SemVer strings (including release candidates and build metadata) are valid HTTP user-agent product versions. HTTP tests verify the header arrives unchanged. Explicit malformed
VERSIONoverrides are outside this change's scope.Minimum Agent Versions
Agent: No minimum version required.
Cluster Agent: No minimum version required.
Describe your test plan
pkg/datadogclient,pkg/controller/utils/datadog, and the monitor, SLO, dashboard, and generic resource controller packages.make managergobuildandmanager --versionconfirm the default local build embeds the short commit.make lintpasses (includinggo vet).Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel[1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits