Skip to content

Conversation

@tbavelier
Copy link
Member

What does this PR do?

Adds DD_DASHBOARD_FORCE_SYNC_PERIOD environment variable to configure DatadogDashboard controller sync frequency, following the same pattern as DD_MONITOR_FORCE_SYNC_PERIOD.

Motivation

#2184 but using local branch for CI to run

Additional Notes

Anything else we should know when reviewing?

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

  1. Enable the dashboard controller and run operator in debug logging level
  2. Add the env var set to "2"
  3. Apply the example dashboard examples/datadogdashboard/simple-dashboard.yaml
  4. Get the lastForceSynctime k get ddd example-dashboard -oyaml | yq .status.lastForceSyncTime: ensure it's less than 2mns old
  5. Review logs to ensure the debug one is picked up:
    {"level":"DEBUG","ts":"2025-10-23T13:08:55.061Z","logger":"controllers.DatadogDashboard","msg":"Setting dashboard force sync period","datadogdashboard":{"name":"example-dashboard","namespace":"system"},"minutes":2}
  6. Do a change in the UI and ensure it's reverted less than 2mns after
  7. Remove the env var, restart the operator and wait for 2mns (after lease happened) and ensure lastForceSyncTime is not updated (because it's been less than 60mns default since the last update)

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

commit 99b5401
Author: Timothée Bavelier <[email protected]>
Date:   Thu Oct 23 14:49:17 2025 +0200

    Update dashboard doc

commit 0fd99dd
Merge: 1ab85a8 9a933b7
Author: Timothée Bavelier <[email protected]>
Date:   Thu Oct 23 14:30:45 2025 +0200

    Merge branch 'main' into add-dashboard-force-sync-period-env

commit 1ab85a8
Author: puretension <[email protected]>
Date:   Mon Oct 20 23:56:45 2025 +0900

    docs: fix duplicated configuration section and reference DD_DASHBOARD_FORCE_SYNC_PERIOD in step 3

    Signed-off-by: puretension <[email protected]>

commit 5b38e10
Merge: 7781b7c 686a1db
Author: Dohyeong Lee <[email protected]>
Date:   Fri Oct 17 21:52:32 2025 +0900

    Merge branch 'main' into add-dashboard-force-sync-period-env

commit 7781b7c
Author: puretension <[email protected]>
Date:   Fri Oct 17 21:50:17 2025 +0900

    Add DD_DASHBOARD_FORCE_SYNC_PERIOD documentation

    Signed-off-by: puretension <[email protected]>

commit d7ce92c
Author: puretension <[email protected]>
Date:   Fri Oct 17 21:49:38 2025 +0900

    Add DD_DASHBOARD_FORCE_SYNC_PERIOD documentation

commit a43835b
Author: puretension <[email protected]>
Date:   Fri Sep 19 12:49:54 2025 +0900

    trigger CI checks after labeling and milestone

    Signed-off-by: puretension <[email protected]>

commit 760353f
Author: puretension <[email protected]>
Date:   Fri Sep 19 00:11:02 2025 +0900

    Add DD_DASHBOARD_FORCE_SYNC_PERIOD environment variable Fixes #2179

    Signed-off-by: puretension <[email protected]>
@tbavelier tbavelier added this to the v1.21.0 milestone Oct 23, 2025
@tbavelier tbavelier requested review from a team as code owners October 23, 2025 14:18
@tbavelier tbavelier added the enhancement New feature or request label Oct 23, 2025
@codecov-commenter
Copy link

codecov-commenter commented Oct 23, 2025

Codecov Report

❌ Patch coverage is 18.18182% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.10%. Comparing base (9a933b7) to head (3f176a2).

Files with missing lines Patch % Lines
internal/controller/datadogdashboard/controller.go 18.18% 8 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2257      +/-   ##
==========================================
- Coverage   39.10%   39.10%   -0.01%     
==========================================
  Files         254      254              
  Lines       26329    26339      +10     
==========================================
+ Hits        10297    10299       +2     
- Misses      15418    15425       +7     
- Partials      614      615       +1     
Flag Coverage Δ
unittests 39.10% <18.18%> (-0.01%) ⬇️

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

Files with missing lines Coverage Δ
internal/controller/datadogdashboard/controller.go 44.51% <18.18%> (-1.60%) ⬇️

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 9a933b7...3f176a2. Read the comment docs.

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

@tbavelier tbavelier changed the title Squashed commit of the following: Add DD_DASHBOARD_FORCE_SYNC_PERIOD environment variable Oct 23, 2025
@tbavelier tbavelier merged commit 2f69d01 into main Oct 23, 2025
31 of 35 checks passed
@tbavelier tbavelier deleted the tbavelier/puretension/add-dashboard-force-sync branch October 23, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants