Repository navigation
fix(telemetry): avoid multiple flush on app closing - #20015
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
Conversation
🎉 All green!🧪 All tests passed 🔗 Commit SHA: aded7a1 | Docs | View more details | Give us feedback! |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
BenchmarksBenchmark execution time: 2026-09-04 10:37:27 Comparing candidate commit aded7a1 in PR branch Found 0 performance improvements and 7 performance regressions! Performance is the same for 574 metrics, 10 unstable metrics, 1 known flaky benchmarks, 17 flaky benchmarks without significant changes.
|
05f9ce5 to
9a8ebf9
Compare
Codeowners resolved asResolved from the full PR diff against No remaining files require a CODEOWNERS review. |
Dependency direction analysis
|
Circular import analysis
|
88dd8bb to
99c7e11
Compare
99c7e11 to
cc1dfa5
Compare
Description
This PR removes unnecessary flushing logic for telemetry happening at app closing. #19368 switched to the native Rust telemetry implementation. I suspect that the previous underlying stop() implementation didn't flush/sent app-closing event automatically, but the new native telemetry worker does on shutdown (both flush and sending
app-closing), so:send_app_closingtweak anymore onstop(): unless we change the telemetry worker in libdatadog, we can't opt out ofapp-closing. I kept the parameter because I feel like this ought to be fixed and not just ignored, but it was already ineffective. Happy to do the follow-up work in libdatadog to provide a way to stop the worker without sending theapp-closingevent if requested.stop(): the worker shutdown code already takes care of the flushThe additional flush is creating the following batches for a short-lived app that does nothing:
While the new version does the expected
This has been discovered as part of investigating #19915, and does help getting back a few dozen ms of shutdown time (50 to 100ms locally, once pooling has been enabled - see (DataDog/libdatadog#2440)) by saving one HTTPS request.
Testing
Tested locally on the repro of #19915. Included a regression test.
Risks
No major risk identified.
Additional Notes
See https://datadoghq.atlassian.net/browse/APMS-20441