-
-
Notifications
You must be signed in to change notification settings - Fork 451
Continuous Profiling - Add delayed stop #4293
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
Merged
Merged
Conversation
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
Added platform "android" in ProfileChunk envelope items
…dContinuousProfiler Added "delayed" stop of profiler, which stops the profiler after the current chunk is finished Added default span data (profiler id, thread name and thread id) to transaction root span
|
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
a948dac | 406.28 ms | 452.18 ms | 45.91 ms |
ea6dc38 | 409.39 ms | 488.18 ms | 78.79 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
a948dac | 1.58 MiB | 2.22 MiB | 653.05 KiB |
ea6dc38 | 1.58 MiB | 2.08 MiB | 505.31 KiB |
7 tasks
markushi
approved these changes
Apr 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
sentry-android-core/src/main/java/io/sentry/android/core/AndroidContinuousProfiler.java
Show resolved
Hide resolved
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.
📜 Description
Replaced synchronized blocks with AutoClosableReentrantLock in AndroidContinuousProfiler - unrelated to delayed stop, but small enough to be added in this PR
Added "delayed" stop of profiler, which stops the profiler after the current chunk is finished
Added default span data (profiler id, thread name and thread id) to transaction root span - unrelated to delayed stop, but this was causing the
ui.load
span to not have the thread id and thread name attached, breaking the link to the continuous profile. A fix is already deployed on the frontend, which fallbacks to the main thread in such cases, but we should still fix it anyway in the SDK💡 Motivation and Context
The goal of continuous profiling is to send profile chunks 1 minute long, as it's more efficient to store few large chunks than multiple small chunks. To avoid the case when a profiler is started and stopped multiple times in the minute time range, causing multiple small chunks to be captured, we now wait until the chunk is finished to stop the profiler.
Note: closing the SDK through
Sentry.close()
doesn't wait anything💚 How did you test it?
Unit tests
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps