perf(core): [Logs and Metrics Enable Flags 16] Avoid unused Metrics worker thread - #5957
Open
adinauer wants to merge 4 commits into
Open
perf(core): [Logs and Metrics Enable Flags 16] Avoid unused Metrics worker thread#5957adinauer wants to merge 4 commits into
adinauer wants to merge 4 commits into
Conversation
Avoid scheduling Metrics processor work for empty flush and close operations until the processor accepts its first item. Preserve existing batching, restart, and Android background behavior after first use. Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Aug 13, 2026
📲 Install BuildsAndroid
|
8 tasks
…h-thread-first-use
Use package visibility for executor injection so the test-only constructor does not expand the published API. Co-Authored-By: Claude <noreply@anthropic.com>
8 tasks
Contributor
Performance metrics 🚀
|
8 tasks
…h-thread-first-use
8 tasks
adinauer
marked this pull request as ready for review
August 13, 2026 13:41
adinauer
requested review from
markushi,
romtsn and
runningcode
as code owners
August 13, 2026 13:41
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.
PR Stack (Logs and Metrics Enable Flags)
📜 Description
Defers Metrics batch processor work until the processor accepts its first Metrics item.
Before first use, empty flushes and normal or restart closes do not schedule processor work. Rejected items do not mark the processor as used. After the first accepted item, batching, flush, restart-close, and Android background behavior remain unchanged.
💡 Motivation and Context
The Metrics enable flag is gone, so every initialized SDK now creates a real Metrics batch processor. Avoid starting its executor thread for applications that never capture Metrics.
💚 How did you test it?
./gradlew :sentry:test :sentry-android-core:testReleaseUnitTest./gradlew spotlessApply apiDump📝 Checklist
sendDefaultPIIis enabled.#skip-changelog