-
-
Notifications
You must be signed in to change notification settings - Fork 465
Feat/poc continuous profiling #4556
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
Conversation
…sed on jfr converter bundled with asyncprofiler
… use existing SentryStackFrame instead of JfrFrame,
…inuous profiler in sentry init
…t in SentrySpan to work around scientific notation of double, use wall clock profiling
# Conflicts: # sentry/build.gradle.kts # sentry/src/test/java/io/sentry/ExternalOptionsTest.kt # sentry/src/test/java/io/sentry/JsonSerializerTest.kt # sentry/src/test/java/io/sentry/SentryClientTest.kt # sentry/src/test/java/io/sentry/SentryOptionsTest.kt
…using external options
…d of file extension
|
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b750b96 | 408.98 ms | 480.32 ms | 71.34 ms |
| ee747ae | 357.79 ms | 421.84 ms | 64.05 ms |
| 3998a95 | 415.94 ms | 478.54 ms | 62.60 ms |
| 85d7417 | 347.21 ms | 394.35 ms | 47.15 ms |
| 806307f | 357.85 ms | 424.64 ms | 66.79 ms |
| d217708 | 409.83 ms | 474.72 ms | 64.89 ms |
| c8125f3 | 397.65 ms | 485.14 ms | 87.49 ms |
| ee747ae | 396.82 ms | 441.67 ms | 44.86 ms |
| 3699cd5 | 423.60 ms | 495.52 ms | 71.92 ms |
| f634d01 | 359.58 ms | 433.88 ms | 74.30 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b750b96 | 1.58 MiB | 2.10 MiB | 533.19 KiB |
| ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
| 3998a95 | 1.58 MiB | 2.10 MiB | 532.96 KiB |
| 85d7417 | 1.58 MiB | 2.10 MiB | 533.44 KiB |
| 806307f | 1.58 MiB | 2.10 MiB | 533.42 KiB |
| d217708 | 1.58 MiB | 2.10 MiB | 532.97 KiB |
| c8125f3 | 1.58 MiB | 2.10 MiB | 532.32 KiB |
| ee747ae | 1.58 MiB | 2.10 MiB | 530.95 KiB |
| 3699cd5 | 1.58 MiB | 2.10 MiB | 533.45 KiB |
| f634d01 | 1.58 MiB | 2.10 MiB | 533.40 KiB |
Previous results on branch: feat/poc-continuous-profiling
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0939549 | 368.64 ms | 439.17 ms | 70.52 ms |
| 212c151 | 372.36 ms | 456.94 ms | 84.58 ms |
| abfc274 | 384.37 ms | 412.52 ms | 28.15 ms |
| f172894 | 363.82 ms | 424.87 ms | 61.06 ms |
| 9e8e7bb | 381.60 ms | 425.33 ms | 43.72 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0939549 | 1.58 MiB | 2.10 MiB | 535.24 KiB |
| 212c151 | 1.58 MiB | 2.10 MiB | 533.69 KiB |
| abfc274 | 1.58 MiB | 2.10 MiB | 535.19 KiB |
| f172894 | 1.58 MiB | 2.10 MiB | 535.19 KiB |
| 9e8e7bb | 1.58 MiB | 2.10 MiB | 533.10 KiB |
sentry/src/main/java/io/sentry/protocol/profiling/JfrToSentryProfileConverter.java
Outdated
Show resolved
Hide resolved
sentry/src/main/java/io/sentry/protocol/profiling/JfrFrame.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/sentry/asyncprofiler/provider/AsyncProfilerContinuousProfilerProvider.java
Outdated
Show resolved
Hide resolved
.../src/main/java/io/sentry/asyncprofiler/convert/JfrAsyncProfilerToSentryProfileConverter.java
Outdated
Show resolved
Hide resolved
|
@sentry review |
.../src/main/java/io/sentry/asyncprofiler/convert/JfrAsyncProfilerToSentryProfileConverter.java
Outdated
Show resolved
Hide resolved
…sentry-java into feat/poc-continuous-profiling
🚨 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:
|
🚨 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:
|
🚨 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:
|
|
@cursor review |
|
@sentry review |
sentry/src/main/java/io/sentry/protocol/profiling/SentrySample.java
Outdated
Show resolved
Hide resolved
...y-async-profiler/src/main/java/io/sentry/asyncprofiler/profiling/JavaContinuousProfiler.java
Show resolved
Hide resolved
...y-async-profiler/src/main/java/io/sentry/asyncprofiler/profiling/JavaContinuousProfiler.java
Show resolved
Hide resolved
...y-async-profiler/src/main/java/io/sentry/asyncprofiler/profiling/JavaContinuousProfiler.java
Show resolved
Hide resolved
…sentry-java into feat/poc-continuous-profiling
🚨 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:
|
🚨 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:
|
🚨 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:
|
🚨 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:
|
| && scopes.getOptions().isContinuousProfilingEnabled() | ||
| && scopes.getOptions().getProfileLifecycle() == ProfileLifecycle.TRACE) { | ||
| scopes.getOptions().getContinuousProfiler().stopProfiler(ProfileLifecycle.TRACE); | ||
| } |
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.
Bug: Profiler Stops Prematurely for Unsampled Spans
The OtelSentrySpanProcessor.onEnd method stops the continuous profiler for root spans without checking if the span was sampled or if its profiler ID matches the currently active global profiler. This can lead to the profiler stopping prematurely, affecting other active traces.
📜 Description
💡 Motivation and Context
Initial implementation of #2635
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Note
Adds async-profiler–backed JVM continuous profiling with ServiceLoader SPI, new SentryProfile payload in ProfileChunk, TRACE lifecycle start/stop, and related options/rate-limiting updates.
sentry-async-profilermodule (async-profiler 3.0) with providers forJavaContinuousProfilerand JFR→Sentry conversion.JavaContinuousProfilerProvider,JavaProfileConverterProviderand loaderProfilingServiceLoader.ProfileChunkwithplatform,profile(structuredSentryProfile) and precise timestamps; keep Base64 path for Android; addPLATFORM_ANDROID/PLATFORM_JAVA.profiling.SentryProfile,SentrySample,SentryThreadMetadata;SentryStackFrameequality/hash.Scopesand OTel span processor; propagate profiler id to spans/transactions.profilevia converter for JVM, Base64 for Android.profile-session-sample-rate,profiling-traces-dir-path,profile-lifecycle; expose inSentryOptionsand properties parsing.profile_chunkcategory in addition toprofile_chunk_ui.PLATFORM_ANDROID.Written by Cursor Bugbot for commit 66413a0. This will update automatically on new commits. Configure here.