[Backport v1.25] [DatadogMonitor] Unregister metrics forwarder on finalization#2824
Merged
[Backport v1.25] [DatadogMonitor] Unregister metrics forwarder on finalization#2824
Conversation
* [DatadogMonitor] Unregister metrics forwarder on finalization * ignore 404 not found and consider success (cherry picked from commit 15a35f5)
tbavelier
approved these changes
Mar 25, 2026
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v1.25 #2824 +/- ##
==========================================
- Coverage 38.65% 38.64% -0.01%
==========================================
Files 309 309
Lines 26727 26734 +7
==========================================
+ Hits 10330 10331 +1
- Misses 15623 15627 +4
- Partials 774 776 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport 15a35f5 from #2804.
What does this PR do?
DatadogMonitor, make sure to un-register its associated metrics forwarder to close the channel404: if a monitor in the process of being deleted is not found, it was already deleted from the UI/api somewhere else, so we should keep proceeding with the deletion. All other errors should be retriedMotivation
Fixes #2803 -> goroutine leak
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?
Describe your test plan
--datadogMonitorEnabled=true(requires addingDD_API_KEYandDD_APP_KEYto your operator deployment)k port-forward deploy/datadog-operator-manager 8080:8080curl -s localhost:8080/metrics | grep -i go_goroutinesNAMESPACE=<operator namespace> bash datadogmonitor-load-test.sh create 100NAMESPACE=<operator namespace> bash datadogmonitor-load-test.sh deleteLoad test script
Checklist
bug,enhancement,refactoring,documentation,tooling, and/ordependenciesqa/skip-qalabel