← Back to Pull requests

Merge Cyrille's DDOT SDK branch into main with a flow env var #412

Open
mx-psi opened this pull request with 16802 lines diff across 143 files
View on GitHub
mx-psi mx-psi commented on Oct 01, 2026 11:51 UTC
Author

What does this PR do?

<!--
A brief description of the change being made with this pull request.
If the description here cannot be expressed in a succinct form, consider
opening multiple pull requests instead of a single one.
-->

Introduces a new DD_INSTALL_FLOW variable that can be set to upstream or ddot and that, when set to ddot, reproduces the behavior on cyrille-leclerc/ddot-sdks-injection branch's install script.

Motivation

<!--
What inspired you to submit this pull request?
Link any related GitHub issues or PRs here.
-->

Make sure we work on a single branch and don't duplicate efforts. Make sure users have an easy time choosing between the two flows.

Notes on reviewing this PR

This PR is huge, sorry. I have tried to split some parts but it's unavoidable that some parts are big. Changes on the examples folder are autogenerated and so can be only skimmed through/ignored.

I have tried so that commits are atomic. I asked Claude to add references to the commits on the original branch the changes refer to, I have not checked every reference but the spot checks I did check out and may be useful for context.

Diff: 16802 lines (+16751 / -51) across 143 files Reviewer: jade-guiton-dd Review duration: 8190m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.72) × (1 − Review Confidence (0.77)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.72 · 16802 lines diff across 143 files
0.72
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.55 · 5 substantive comment(s)
0.55
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
77%
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.400
Mass File Touch mass_file_touch
0.080
Real PR Conversation Timeline
15 items
chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Oct 01, 2026 12:11 UTC
Bot

<!-- codex-pull-request-review-summary -->

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-10-02T09:25:28.671333Z">2026-10-02T09:25:28.671333Z</relative-time> | 0a5d537 | New commits |

<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review

  • Mark a draft as ready

  • Comment "@codex review" or "@codex security review".
  • Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

    </details>

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Oct 01, 2026 12:15 UTC
    Code Review
    guides/kubernetes/configuration/opentelemetry-kube-stack/install:1
    @@ -65,12 +127,53 @@ if [[ -n "${K8S_CLUSTER_NAME:-}" ]]; then
         HELM_SET_ARGS+=(--set-string "resourceAttributes.k8s\.cluster\.name=$K8S_CLUSTER_NAME")
     fi
     
    -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
    -
     helm upgrade opentelemetry-kube-stack \
         open-telemetry/opentelemetry-kube-stack \
    -    --version 0.20.8 \
    +    --version 0.21.0 \
         --install \
         --namespace opentelemetry-operator-system \
         "${HELM_SET_ARGS[@]}" \
    -    -f "$SCRIPT_DIR/values-otlp-http.yaml"
    +    -f "$SCRIPT_DIR/$VALUES_FILE" \
    +    ${HOST_PROFILER_ENABLED_ARGS[@]+"${HOST_PROFILER_ENABLED_ARGS[@]}"} \
    +    ${OVERLAY_VALUES_ARGS[@]+"${OVERLAY_VALUES_ARGS[@]}"}
    +
    +if [[ "$DD_INSTALL_FLOW" == "ddot" ]]; then
    +    # The standard and Cilium policies select the same pods and Kubernetes
    +    # NetworkPolicies are additive: remove both NetworkPolicy before applying
    +    # the selected one (or none), so a policy from a previous run cannot widen
    +    # the requested egress.
    +    kubectl delete networkpolicy \
    +      --namespace opentelemetry-operator-system \
    +      --ignore-not-found=true \
    +      opentelemetry-kube-stack-host-profiler-egress \
    +      || echo "WARNING: Could not delete the host-profiler NetworkPolicy. Continuing..."
    +    kubectl delete ciliumnetworkpolicy \
    +      --namespace opentelemetry-operator-system \
    +      --ignore-not-found=true \
    +      opentelemetry-kube-stack-host-profiler-egress \
    +      || echo "WARNING: CiliumNetworkPolicy CRD not installed. Continuing..."
    +fi
    +
    +if [[ -n "$HOST_PROFILER_NETWORK_POLICY_FILE" ]]; then
    +    echo "Applying the host-profiler egress NetworkPolicy..."
    +    kubectl apply -f "$HOST_PROFILER_NETWORK_POLICY_FILE" \
    +      || echo "WARNING: Could not apply the host-profiler egress NetworkPolicy (is Cilium installed if you chose the Cilium policy?). Continuing..."
    +fi
    +
    +if [[ "$DD_INSTALL_FLOW" == "ddot" ]]; then

    <sub><sub>!P2 Badge</sub></sub> Remove the Datadog Agent when selecting upstream

    When ./install is rerun on an existing DDOT installation with DD_INSTALL_FLOW=upstream, this conditional simply skips the Agent upgrade; it never uninstalls the separate ddagent-kube-stack Helm release. The Agent DaemonSet therefore continues running and sending telemetry despite the installation now being configured for the upstream flow. Add an upstream cleanup path for the Agent release, as the separate cleanup already performed by uninstall demonstrates is required.

    Useful? React with 👍 / 👎.

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Oct 01, 2026 12:15 UTC
    Reviewer

    💡 Codex Review

    Here are some automated review suggestions for this pull request.

    Reviewed commit: 7ea27a6240

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

    Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review

  • Mark a draft as ready

  • Comment "@codex review".
  • If Codex has suggestions, it will comment; otherwise it will react with 👍.

    Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    </details>

    mx-psi mx-psi commented on code on Oct 01, 2026 12:17 UTC
    Code Review
    guides/kubernetes/configuration/opentelemetry-kube-stack/install:1
    @@ -65,12 +127,53 @@ if [[ -n "${K8S_CLUSTER_NAME:-}" ]]; then
         HELM_SET_ARGS+=(--set-string "resourceAttributes.k8s\.cluster\.name=$K8S_CLUSTER_NAME")
     fi
     
    -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
    -
     helm upgrade opentelemetry-kube-stack \
         open-telemetry/opentelemetry-kube-stack \
    -    --version 0.20.8 \
    +    --version 0.21.0 \
         --install \
         --namespace opentelemetry-operator-system \
         "${HELM_SET_ARGS[@]}" \
    -    -f "$SCRIPT_DIR/values-otlp-http.yaml"
    +    -f "$SCRIPT_DIR/$VALUES_FILE" \
    +    ${HOST_PROFILER_ENABLED_ARGS[@]+"${HOST_PROFILER_ENABLED_ARGS[@]}"} \
    +    ${OVERLAY_VALUES_ARGS[@]+"${OVERLAY_VALUES_ARGS[@]}"}
    +
    +if [[ "$DD_INSTALL_FLOW" == "ddot" ]]; then
    +    # The standard and Cilium policies select the same pods and Kubernetes
    +    # NetworkPolicies are additive: remove both NetworkPolicy before applying
    +    # the selected one (or none), so a policy from a previous run cannot widen
    +    # the requested egress.
    +    kubectl delete networkpolicy \
    +      --namespace opentelemetry-operator-system \
    +      --ignore-not-found=true \
    +      opentelemetry-kube-stack-host-profiler-egress \
    +      || echo "WARNING: Could not delete the host-profiler NetworkPolicy. Continuing..."
    +    kubectl delete ciliumnetworkpolicy \
    +      --namespace opentelemetry-operator-system \
    +      --ignore-not-found=true \
    +      opentelemetry-kube-stack-host-profiler-egress \
    +      || echo "WARNING: CiliumNetworkPolicy CRD not installed. Continuing..."
    +fi
    +
    +if [[ -n "$HOST_PROFILER_NETWORK_POLICY_FILE" ]]; then
    +    echo "Applying the host-profiler egress NetworkPolicy..."
    +    kubectl apply -f "$HOST_PROFILER_NETWORK_POLICY_FILE" \
    +      || echo "WARNING: Could not apply the host-profiler egress NetworkPolicy (is Cilium installed if you chose the Cilium policy?). Continuing..."
    +fi
    +
    +if [[ "$DD_INSTALL_FLOW" == "ddot" ]]; then

    I feel like the way to change the install flow should be to run uninstall and then install, otherwise this will get unwieldy.

    jade-guiton-dd jade-guiton-dd commented on code on Oct 01, 2026 12:52 UTC
    Code Review
    generate/main.go:1
    @@ -16,10 +16,15 @@ const guideDir = "../guides/kubernetes/configuration/opentelemetry-kube-stack"
     
     type mode struct {
     	name string
    +	// DDOT enables the ddot-flow sections of values.yaml.tmpl.
    +	DDOT bool

    Nit: why are these exported?

    jade-guiton-dd jade-guiton-dd commented on code on Oct 01, 2026 12:54 UTC
    Code Review
    guides/kubernetes/configuration/opentelemetry-kube-stack/values.yaml.tmpl:1
    @@ -524,29 +551,43 @@ collectors:
               logs:
                 receivers: [otlp]
                 processors: [resource_detection/env]
    -            exporters: [otlp_http]
    +            exporters: [{{.Exporter}}]
     
               traces:
                 receivers: [otlp]
                 processors: [resource_detection/env]
    +{{- if .DDOT}}
    +            exporters: [datadog/connector]
    +{{- else}}
                 exporters: [forward, span_metrics]
    +{{- end}}
     
               # Add sampling processors here if needed.
               traces/sampling:
    +{{- if .DDOT}}
    +            receivers: [datadog/connector]
    +{{- else}}
                 receivers: [forward]
    -            exporters: [otlp_http]
    +{{- end}}
    +            exporters: [{{.Exporter}}]
    +{{- if not .DDOT}}
     
               metrics/span_metrics:
                 receivers: [span_metrics]
    -            exporters: [otlp_http]
    +            exporters: [{{.Exporter}}]
    +{{- end}}
     
               metrics:
    +{{- if .DDOT}}
    +            receivers: [datadog/connector, otlp]

    Nit: Why not put datadog/connector where span_metrics is in metrics/span_metrics? Shouldn't change anything but it's weird to apply these three processors to its output

    jade-guiton-dd jade-guiton-dd commented on code on Oct 01, 2026 12:56 UTC
    Code Review
    generate/main.go:1
    @@ -16,10 +16,15 @@ const guideDir = "../guides/kubernetes/configuration/opentelemetry-kube-stack"
     
     type mode struct {
     	name string
    +	// DDOT enables the ddot-flow sections of values.yaml.tmpl.
    +	DDOT bool
    +	// Exporter is the exporter that every pipeline in values.yaml.tmpl uses.
    +	Exporter string

    Nit: Is Exporter orthogonal to DDOT, or could it be determined based on it?

    jade-guiton-dd jade-guiton-dd commented on code on Oct 01, 2026 13:00 UTC
    Code Review
    guides/kubernetes/configuration/opentelemetry-kube-stack/install:1
    @@ -53,6 +62,11 @@ HELM_SET_ARGS=(
         --set-string "resourceAttributes.deployment\.environment\.name=$DEPLOYMENT_ENVIRONMENT_NAME"
     )
     
    +if [[ "$DD_INSTALL_FLOW" == "ddot" ]]; then
    +    # FIXME use deployment.environment.name, it's a workaround for https://github.com/DataDog/dd-trace-java/pull/12324
    +    HELM_SET_ARGS+=(--set-string "resourceAttributes.deployment\.environment=$DEPLOYMENT_ENVIRONMENT_NAME")
    +fi

    Nit: Isn't there already a workaround for that in one of the YAML files?

    wehzzz wehzzz commented on code on Oct 01, 2026 13:02 UTC
    Code Review
    guides/kubernetes/configuration/opentelemetry-kube-stack/.env.example:1
    @@ -8,3 +10,7 @@ export DD_API_KEY=xxxxxxx
     # export K8S_CLUSTER_NAME=
     # Value of the deployment.environment.name resource attribute. Default: production.
     # export DEPLOYMENT_ENVIRONMENT_NAME=production
    +# Enable the eBPF host profiler: true or false. Requires DD_INSTALL_FLOW=ddot and Linux nodes with kernel >= 5.10. Default: false.

    The host-profiler should be installed regardless of the selected DD_INSTALL_FLOW (while still giving the user the choice to opt out via the existing cli prompt).

    Right now, we don't have a viable upstream alternative to the eBPF profiler because upstream is prone to frequent regressions. The host-profiler is essentially a wrapper that adds testing to ensure we ship a stable version. Furthermore, host-profiler itself is a fully configurable OTel distribution, just like any other.

    Here is a more detailed explanation of why we do not support the upstream profiler right now and why host-profiler should be present in both flows: https://dd.slack.com/archives/C06F2EP2SDA/p1789139615767619?thread_ts=1788344651.328959&cid=C06F2EP2SDA

    jade-guiton-dd jade-guiton-dd approved these changes on Oct 01, 2026 13:11 UTC
    Approved Reviewer

    Looks good, just a few questions it's fine to address later

    mx-psi mx-psi commented on code on Oct 01, 2026 14:21 UTC
    Code Review
    generate/main.go:1
    @@ -16,10 +16,15 @@ const guideDir = "../guides/kubernetes/configuration/opentelemetry-kube-stack"
     
     type mode struct {
     	name string
    +	// DDOT enables the ddot-flow sections of values.yaml.tmpl.
    +	DDOT bool

    This field is used on the template, and text/template requires that the fields it uses are exported:

    unlike with field names they do not need to start with an upper case letter

    (a bit of a weird quote, it's not documented explicitly in the fields docs but I think it is clear enough). I assume it uses reflect in some way.

    cyrille-leclerc cyrille-leclerc commented on code on Oct 01, 2026 14:31 UTC
    Code Review
    guides/kubernetes/configuration/opentelemetry-kube-stack/values.yaml.tmpl:1
    @@ -2,6 +2,9 @@ clusterName: ""
     
     resourceAttributes:
       deployment.environment.name: production # overwrite as needed
    +{{- if .DDOT}}
    +  deployment.environment: production # FIXME only use deployment.environment.name, it's a workaround for https://github.com/DataDog/dd-trace-java/pull/12324

    can we get rid of this workaround? at least for Java we bumped the sdk version and benefit the fix, I don't know for other languages.

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on code on Oct 02, 2026 09:25 UTC
    Code Review
    guides/kubernetes/configuration/opentelemetry-kube-stack/dd-agent-values.yaml:1
    @@ -0,0 +1,76 @@
    +# --- Set by CLI args ---
    +#datadog:
    +#  apiKeyExistingSecret: datadog-secret
    +#  clusterName: <...>
    +#  site: <...>
    +
    +# We want live debugger & dynamic instrumentation
    +# but don't need the cluster agent & k8s monitoring (done by the OTel collector)
    +datadog:
    +  # Uncomment if you have Go apps to instrument:
    +  #dynamicInstrumentationGo:
    +  #  enabled: true
    +  discovery:
    +    enabled: false # no-op on agent >= 7.78.0, real switch is DD_DISCOVERY_ENABLED below
    +  operator:
    +    enabled: false
    +  clusterChecks:
    +    enabled: false
    +  kubeStateMetricsCore:
    +    enabled: false
    +  orchestratorExplorer:
    +    enabled: false
    +    kubelet_configuration_check:
    +      enabled: false # no-op in the chart, real switch is the env var below
    +  processAgent:
    +    enabled: false

    <sub><sub>!P2 Badge</sub></sub> Disable the Agent's remaining Kubernetes collectors

    For every ddot installation, processAgent.enabled: false does not achieve the stated goal of leaving Kubernetes monitoring to the OpenTelemetry collectors. The checked-in render in examples-datadog-agent/default/rendered/daemonset.yaml still sets DD_PROCESS_CONFIG_CONTAINER_COLLECTION_ENABLED, DD_PROCESS_AGENT_DISCOVERY_ENABLED, DD_CONTAINER_LIFECYCLE_ENABLED, DD_CONTAINER_IMAGE_ENABLED, and DD_KUBELET_CORE_CHECK_ENABLED to true, so the Agent continues collecting kubelet/container telemetry already handled by the OTel daemon. Explicitly disable these core-Agent Kubernetes collection features while retaining only those required for dynamic instrumentation.

    Useful? React with 👍 / 👎.

    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Oct 02, 2026 09:25 UTC
    Reviewer

    💡 Codex Review

    Here are some automated review suggestions for this pull request.

    Reviewed commit: 0a5d537127

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

    Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review

  • Mark a draft as ready

  • Comment "@codex review".
  • If Codex has suggestions, it will comment; otherwise it will react with 👍.

    Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

    </details>

    Assignees
    mx-psi mx-psi
    Labels
    risk: low confidence: 77.1% 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: 71.5% (HIGH) · Higher = larger blast radius
    71.5%
    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: 77.1% · Lower = rushed or shallow review
    77.1%
    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: 16.4% · Safe to merge
    16.4%