Skip to content

Conversation

lbloder
Copy link
Collaborator

@lbloder lbloder commented Jul 29, 2025

📜 Description

  • Support ProfileLifecycle.TRACE with Sentry Tracing as well as OpenTelemetry
  • Improve timestamp calculation
  • Use improved command to start async profiler
  • Enum for Platform in ProfileChunk
  • Fix most comments from Feat/poc continuous profiling #4556

💡 Motivation and Context

Follow-Up to #4556

💚 How did you test it?

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Copy link
Contributor

github-actions bot commented Jul 29, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Support ProfileLifecycle.TRACE ([#4576](https://github.com/getsentry/sentry-java/pull/4576))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against e43f1a2

Copy link
Contributor

github-actions bot commented Jul 29, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 439.92 ms 478.18 ms 38.26 ms
Size 1.58 MiB 2.09 MiB 521.13 KiB

Baseline results on branch: feat/poc-continuous-profiling

Startup times

Revision Plain With Sentry Diff
d53675e 447.81 ms 457.62 ms 9.80 ms

App size

Revision Plain With Sentry Diff
d53675e 1.58 MiB 2.09 MiB 520.14 KiB

Previous results on branch: feat/continuous-profiling-02

Startup times

Revision Plain With Sentry Diff
ac08652 442.71 ms 446.19 ms 3.48 ms
c21fbdb 420.29 ms 449.88 ms 29.59 ms

App size

Revision Plain With Sentry Diff
ac08652 1.58 MiB 2.09 MiB 521.13 KiB
c21fbdb 1.58 MiB 2.09 MiB 521.13 KiB

@lbloder lbloder mentioned this pull request Aug 4, 2025
9 tasks
@adinauer
Copy link
Member

adinauer commented Aug 4, 2025

@sentry review

@lbloder lbloder marked this pull request as ready for review August 4, 2025 08:57
@lbloder lbloder requested a review from adinauer as a code owner August 4, 2025 08:57
@adinauer
Copy link
Member

adinauer commented Aug 4, 2025

cursor review

cursor[bot]

This comment was marked as outdated.

* add readme and info about commit of the source repository

* delete jfr file on jvm exit

* further split into smaller methods

* deduplicate frames in order to save bandwidth, add converter tests

* remove Platform Enum, use string constants instead for compatibility with cross platform frameworks

* implement equals and hashcode for SentryStackFrame to make frame deduplication work

* bump api

* improve error handling, fix start stop start flow

* add new testfile

* calculate ticksPerNanosecond in constructor

* adapt Ratelimiter to check for both ProfileChunk and ProfileChunkUi ratelimiting

* update ratelimiter test to check for both profileChunk and profileChunkUi drops

* use string constant instead of string

* Format code

* add non aggregating event collector to send each event individually, deduplicate stacks

* adapt converter tests to new non-aggregated converter

* Format code

* add logging to loadProfileConverter

* Format code

* fix duplication of events

* catch all exception happening when converting from jfr

* add exists and writable info to log message

* add method to safely delete file

* remove setNative call

* fix test

* fix reference to commit we vendored from

* drop event if it cannot be processed to not lose the whole chunk

* make format

* fix test

* Format code

* Profiling - OTEL profiling fix, Stabilization, Logging (#4746)

* add skipProfiling flag to TransactionOptions to be able to skip profiling and handle cases where profiling has been started by otel

* add profilerId to spanContext so that otel span processor can propagate this to the exporter and SentryTracer

* immediately end profiling when stopProfiler is called

* bump api, fix android api 24 code

* catch all exception happening when converting from jfr

* simplify JavaContinuous profiler by catching AsyncProfiler instantiation exceptions in provider

* add exists and writable info to log message

* add method to safely delete file

* remove setNative call

* fix test

* fix reference to commit we vendored from

* drop event if it cannot be processed to not lose the whole chunk

* Format code

* fix test

* Format code

* fix test

* catch exceptions in startProfiler/stopProfiler

* fallback to threadId -1 if it cannot be resolved

---------

Co-authored-by: Sentry Github Bot <[email protected]>

---------

Co-authored-by: Sentry Github Bot <[email protected]>
Copy link
Contributor

🚨 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:

  • sentry/src/main/java/io/sentry/transport/RateLimiter.java

@lbloder lbloder merged commit 3acbd63 into feat/poc-continuous-profiling Sep 26, 2025
33 of 44 checks passed
@lbloder lbloder deleted the feat/continuous-profiling-02 branch September 26, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants