Skip to content

[Backport v1.26] Add experiment signals to fleet remote config#2920

Merged
khewonc merged 1 commit into
v1.26from
backport-2872-to-v1.26
Apr 23, 2026
Merged

[Backport v1.26] Add experiment signals to fleet remote config#2920
khewonc merged 1 commit into
v1.26from
backport-2872-to-v1.26

Conversation

@dd-octo-sts

@dd-octo-sts dd-octo-sts Bot commented Apr 23, 2026

Copy link
Copy Markdown

Backport 0dcbf67 from #2872.


What does this PR do?

Adds experiment signals: start, stop, and promote. This depends on #2838. The latest commit contains the relevant changes

Motivation

https://datadoghq.atlassian.net/browse/CONTP-1424
https://datadoghq.atlassian.net/browse/CONTP-1425
https://datadoghq.atlassian.net/browse/CONTP-1426

Additional Notes

Merge after #2838

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

TBD

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed (see: signing commits)

* initial experiment signals

* Review suggestions

* [FA] Add cluster_name as tag (#2878)

* Add cluster_name as tag

* Add updater_type

* add test logs

* more logs

* use installer config

* Logging + race

* More edge cases

* Add package state pop

* Fix lint

* package state

* Check expected state

* no nsn for stop/promote

* Tweak logging

* Review suggestions + 2x promote fix

---------

Co-authored-by: Paul <[email protected]>
(cherry picked from commit 0dcbf67)
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner April 23, 2026 14:10
@dd-octo-sts dd-octo-sts Bot added enhancement New feature or request backport label added by backport action bot label added by backport bot labels Apr 23, 2026
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner April 23, 2026 14:10
@dd-octo-sts
dd-octo-sts Bot requested a review from a team as a code owner April 23, 2026 14:10
@dd-octo-sts dd-octo-sts Bot added this to the v1.26.0 milestone Apr 23, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79d6e044cc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 199 to +201
if rollbackTarget == "" {
return fmt.Errorf("no previous revision to roll back to")
ctrl.LoggerFrom(ctx).Info("No previous revision to roll back to, skipping spec restore")
return nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore spec when rollback target is empty

When a stopped (or timeout) reconcile happens before the experiment revision exists, revList may contain only the baseline revision, so findRollbackTarget yields an empty name. This branch now returns success, and restorePreviousSpec still advances the phase, which can acknowledge rollback without actually restoring the pre-experiment spec. In that ordering, status reports rollback/timeout while the experiment config remains applied.

Useful? React with 👍 / 👎.

Comment thread pkg/fleet/daemon.go
Comment on lines +277 to +279
nsn := d.experimentTarget
if nsn.Name == "" {
return fmt.Errorf("stop DatadogAgent experiment: no experiment target set")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Derive stop/promote target from persistent state

stopDatadogAgentExperiment relies on d.experimentTarget, which is only populated by a prior start signal and is not persisted across process restarts. After leader restart/failover during a running experiment, this check fails and stop/promote requests are rejected with no experiment target set, even though the DatadogAgent status still has an active experiment. This makes experiment control non-resumable after restart.

Useful? React with 👍 / 👎.

@codecov-commenter

codecov-commenter commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.84595% with 104 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.52%. Comparing base (c3d0d96) to head (79d6e04).

Files with missing lines Patch % Lines
pkg/fleet/daemon.go 69.13% 58 Missing and 17 partials ⚠️
pkg/fleet/experiment.go 83.67% 7 Missing and 1 partial ⚠️
internal/controller/datadogagent/experiment.go 82.50% 4 Missing and 3 partials ⚠️
internal/controller/datadogagent/revision.go 79.41% 4 Missing and 3 partials ⚠️
pkg/remoteconfig/updater.go 0.00% 4 Missing ⚠️
cmd/main.go 0.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##            v1.26    #2920      +/-   ##
==========================================
+ Coverage   40.05%   40.52%   +0.46%     
==========================================
  Files         319      320       +1     
  Lines       28052    28376     +324     
==========================================
+ Hits        11237    11500     +263     
- Misses      15993    16032      +39     
- Partials      822      844      +22     
Flag Coverage Δ
unittests 40.52% <72.84%> (+0.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/fleet/remote_config.go 100.00% <100.00%> (ø)
cmd/main.go 6.66% <0.00%> (ø)
pkg/remoteconfig/updater.go 0.00% <0.00%> (ø)
internal/controller/datadogagent/experiment.go 85.15% <82.50%> (+0.37%) ⬆️
internal/controller/datadogagent/revision.go 78.12% <79.41%> (-3.39%) ⬇️
pkg/fleet/experiment.go 83.67% <83.67%> (ø)
pkg/fleet/daemon.go 65.45% <69.13%> (+65.45%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c3d0d96...79d6e04. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@khewonc
khewonc merged commit 651ae77 into v1.26 Apr 23, 2026
59 of 67 checks passed
@khewonc
khewonc deleted the backport-2872-to-v1.26 branch April 23, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport label added by backport action bot label added by backport bot enhancement New feature or request team/container-autoscaling team/container-platform team/fleet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants