Skip to content

fix(profiling): Disable transaction-based profiling when enableLegacyProfiling is false#5765

Merged
markushi merged 3 commits into
claude/dreamy-solomonfrom
fix/enable-legacy-profiling-disables-transaction-based
Jul 16, 2026
Merged

fix(profiling): Disable transaction-based profiling when enableLegacyProfiling is false#5765
markushi merged 3 commits into
claude/dreamy-solomonfrom
fix/enable-legacy-profiling-disables-transaction-based

Conversation

@markushi

@markushi markushi commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

Broadens enableLegacyProfiling so that setting it to false also disables transaction-based profiling (profilesSampleRate / profilesSampler), not just continuous profiling.

Why

Transaction-based profiling always relies on the legacy Debug-based profiler — it is not supported by the ProfilingManager (Perfetto) backend. Previously enableLegacyProfiling only controlled continuous profiling, which led to a confusing combination:

If someone sets profilesSampleRate and enableLegacyProfiling=false, we would still run the old legacy profiler, as it's in transaction-based profiling mode.

Per discussion, it's sensible that enableLegacyProfiling disables transaction-based profiling too.

Changes

  • AndroidOptionsInitializer.setupProfiler: when the transaction-based path is selected but enableLegacyProfiling is false, no-op both profilers, close any app-start profiler, and log a warning guiding users towards profileSessionSampleRate (continuous profiling).
  • Updated SentryOptions.isEnableLegacyProfiling / setEnableLegacyProfiling javadoc.
  • Added unit tests.
  • Docs updated in a matching sentry-docs change (Perfetto profiling / enableLegacyProfiling option).

#skip-changelog

🤖 Generated with Claude Code

…Profiling is false

Transaction-based profiling (profilesSampleRate/profilesSampler) always relies
on the legacy Debug-based profiler and is not supported by the ProfilingManager
(Perfetto) backend. Previously enableLegacyProfiling only controlled continuous
profiling, so profilesSampleRate + enableLegacyProfiling=false would still run
the legacy transaction profiler.

Now setting enableLegacyProfiling to false also disables transaction-based
profiling on all devices, logging a warning to guide users towards
profileSessionSampleRate for continuous profiling.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@markushi markushi force-pushed the fix/enable-legacy-profiling-disables-transaction-based branch from af1a5cb to 201d373 Compare July 15, 2026 11:21
@sentry

sentry Bot commented Jul 15, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.48.0 (1) release

⚙️ sentry-android Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 318.43 ms 358.00 ms 39.57 ms
Size 0 B 0 B 0 B

Baseline results on branch: claude/dreamy-solomon

Startup times

Revision Plain With Sentry Diff
e729c4a 360.54 ms 459.90 ms 99.36 ms
b4857f6 314.92 ms 358.61 ms 43.69 ms

App size

Revision Plain With Sentry Diff
e729c4a 0 B 0 B 0 B
b4857f6 0 B 0 B 0 B

@romtsn romtsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one changelog nit, LGTM otherwise!

Comment thread CHANGELOG.md Outdated
@markushi markushi merged commit 9d3cb80 into claude/dreamy-solomon Jul 16, 2026
56 of 59 checks passed
@markushi markushi deleted the fix/enable-legacy-profiling-disables-transaction-based branch July 16, 2026 11:41
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.

2 participants