Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[profiles] Add event filter for watching dap #1249

Merged
merged 3 commits into from
Jun 27, 2024
Merged

Conversation

khewonc
Copy link
Contributor

@khewonc khewonc commented Jun 25, 2024

What does this PR do?

Add an event filter to send DDA reconcile requests only when a DAP generation changes.

Motivation

Increased reconciles after adding DAP status since every DAP change was causing a DDA reconcile request.
https://datadoghq.atlassian.net/browse/CECO-1219

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: n/a
  • Cluster Agent: n/a

Describe your test plan

Staging:

  • Deploy the operator and check that the number of reconciles decreases

Other:

  • Deploy an operator and spin up a DDA and profile
  • Look at the number of reconciles. You can use the timestamp and Reconciling DatadogAgent log in the operator logs or the metric datadog.operator.controller_runtime_reconcile_total with controller:datadogagent. With default settings, it should be around 1 reconcile per 15 sec
  • Edit the profile so that it won't change the generation (edit the status or add a label)
  • Check that the profile generation remains the same (kubectl describe dap <profile>) and that the datadogagent reconcile count doesn't change per time period since the generation hasn't changed
  • Edit the profile to change its generation (edit the profile spec)
  • Check that the profile generation increases and that there's an extra datadogagent reconcile

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

@khewonc khewonc added the enhancement New feature or request label Jun 25, 2024
@khewonc khewonc added this to the v1.8.0 milestone Jun 25, 2024
@khewonc khewonc requested review from a team as code owners June 25, 2024 19:06
@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.32%. Comparing base (ff60347) to head (c44bac0).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1249   +/-   ##
=======================================
  Coverage   55.32%   55.32%           
=======================================
  Files         241      241           
  Lines       27889    27890    +1     
=======================================
+ Hits        15430    15431    +1     
  Misses      11587    11587           
  Partials      872      872           
Flag Coverage Δ
unittests 55.32% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
controllers/datadogagent_controller.go 70.79% <100.00%> (+0.26%) ⬆️

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 ff60347...c44bac0. Read the comment docs.

@khewonc khewonc merged commit 7a522d3 into main Jun 27, 2024
19 checks passed
@khewonc khewonc deleted the khewonc/dap-watch-predicate branch June 27, 2024 20:32
mftoure pushed a commit that referenced this pull request Oct 3, 2024
* Add event filter for watching dap

* Add predicate to dap watches only
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.

3 participants