-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
Add Continuous Profiling support (v8) #3710
base: 8.x.x
Are you sure you want to change the base?
Conversation
made AndroidProfiler's executor nullable, as timeout will be handled differently for continuous profiling
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Add Continuous Profiling support (v8) ([#3710](https://github.com/getsentry/sentry-java/pull/3710)) If none of the above apply, you can opt out of this check by adding |
Performance metrics 🚀
|
sentry-android-core/src/main/java/io/sentry/android/core/AndroidContinuousProfiler.java
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/AndroidContinuousProfiler.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/AndroidContinuousProfiler.java
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/AndroidContinuousProfiler.java
Outdated
Show resolved
Hide resolved
sentry-android-core/src/main/java/io/sentry/android/core/AndroidContinuousProfiler.java
Show resolved
Hide resolved
# Conflicts: # sentry-android-core/src/main/java/io/sentry/android/core/AndroidProfiler.java # sentry-android-core/src/main/java/io/sentry/android/core/AndroidTransactionProfiler.java
# Conflicts: # sentry-android-core/src/main/java/io/sentry/android/core/AndroidProfiler.java
* added profile_chunk envelope create * added IHub.captureProfileChunk and ISentryClient.captureProfileChunk * added profilerId and chunkId reset logic to AndroidContinuousProfiler * added absolute timestamps to ProfileMeasurementValue * added ProfileContext to Contexts * removed timestampMillis from MemoryCollectionData and CpuCollectionData, now it uses timestamp.nanotime() to achieve same result * continuous profiler doesn't stop anymore when an error occurs, but continue scheduling restart Instantiate continuous profiling v8 (p3) (#3725) * added profile context to SentryTracer * removed isProfilingEnabled from AndroidContinuousProfiler, as it's useless * added continuous profiler to SentryOptions * added DefaultTransactionPerformanceCollector to AndroidContinuousProfiler * updated DefaultTransactionPerformanceCollector to work with string ids other than transactions * fixed ProfileChunk measurements being modifiable from other code * added thread id and name to SpanContext.data * added profiler_id to span data * close continuous profiler on scopes close * renamed TransactionPerformanceCollector to CompositePerformanceCollector * added SpanContext.data ser/deser Handle App Start Continuous Profiling v8 (p4) (#3730) * create app start continuous profiler instead of transaction profiler, based on config * updated SentryAppStartProfilingOptions with isContinuousProfilingEnabled flag * updated SentryOptions with isContinuousProfilingEnabled() method * cut profiler setup out in a specific function to improve readability of AndroidOptionsInitializer Add new APIs for Continuous Profiling v8 (p5) (#3844) * AndroidContinuousProfiler now retrieve the scopes on start() * removed profilesSampleRate from sample app to enable continuous profiling * added Sentry.startProfiler and Sentry.stopProfiler APIs
# Conflicts: # sentry-opentelemetry/sentry-opentelemetry-bootstrap/src/main/java/io/sentry/opentelemetry/OtelSpanFactory.java # sentry-opentelemetry/sentry-opentelemetry-extra/api/sentry-opentelemetry-extra.api
* continuous profiler now doesn't start if offline or rate limited * continuous profiler stops when rate limited * continuous profiler prevents sending chunks after being closed * added profile_chunk rate limit * continuous profiler now reset its id when rate limited or offline
🚨 Detected changes in high risk code 🚨High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:
|
📜 Description
This is the first part for the continuous profiling support for Android.
Internal doc is here
Part 1
Add the implementation of the continuous profiler itself
Part 2 -> #3711
Create new envelope type and payload
Create and send profile_chunk envelope
Part 3 -> #3725
Instantiate profiler
Set ProfileContext to transactions and spans
Add performance collectors to the profiler
Part 4 -> #3730
Handle app start profiling
Part 5 -> #3844
Add new user-facing APIs
Part 6 -> #3926
Handle rate limiting
Part 7
Update docs
User docs -> getsentry/sentry-docs#11872
💡 Motivation and Context
💚 How did you test it?
Unit tests
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps