[OTAGENT-1367] Resolve hostname without DD_HOSTNAME in standalone DDOT on Kubernetes #57354
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.66) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.66 · 348 lines diff across 4 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.350
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.066
Real PR Conversation Timeline
1 comments
"Review active on #57354"
general
weight: 0.35
agagniere
What does this PR do?
Standalone DDOT (
DD_OTEL_STANDALONE=true) crash-loops in Kubernetes pods unlessDD_HOSTNAMEis set, on EKS as well as kind. There are two independent failures, both fixed here:os.Hostname(), which it refuses inside a container since #51494. None of that works without a core agent. In standalone mode we now hand it the hostname already resolved by the hostname component.DOCKER_DD_AGENT, so the kubelet provider is skipped. The OS hostname is the pod name, and the EC2 provider only runs after another provider found a defaultip-...name. The image now setsDOCKER_DD_AGENT=true, and standalone falls back to the EC2 instance ID when running in Kubernetes with nokubernetes_kubelet_hostconfigured. That is the same hostname the core agent reports on EKS.The trace HTTP receiver stays disabled (
apm_config.receiver_enabled=false), so marking the image as containerized doesn't open a listener on 0.0.0.0. A test covers that.Motivation
OTAGENT-1367. Following the standalone DDOT Operator docs on EKS fails with
unable to reliably determine the host name.Tradeoff: the EC2 fallback is used only when the kubelet host is unset. If it is set but the kubelet is failing, startup still fails, so a brief kubelet outage can't flip a custom-named node between two hostnames across restarts.
Describe how you validated your changes
Unit tests for the fallback and the trace hostname wiring.
On an EKS cluster (3 AL2023 + 2 Bottlerocket nodes), I followed the standalone DDOT Operator docs without
DD_HOSTNAME. Withddot-collector:7.83.1, every pod crash-looped. I then reran with an image made ofddot-collector:7.83.1+ the otel-agent binary from this branch's pipeline +DOCKER_DD_AGENT=true:| Setup | Result |
| --- | --- |
| Docs manifest only (no kubelet settings) | All pods running, 0 restarts. Hostname = EC2 instance ID via the fallback, same as the core agent on each node |
| + kubelet host, TLS verify off,
nodes/proxyRBAC | All pods running. The kubelet provider finds the node name and the EC2 provider swaps in the instance ID. No fallback || Kubelet host set, RBAC removed (403) | Startup fails, as intended: no fallback when the kubelet is configured |
In the running pods, nothing listens on the trace receiver (no
:8126, no APM socket).🤖 Generated with Claude Code
[OTAGENT-1367]: https://datadoghq.atlassian.net/browse/OTAGENT-1367?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ