Skip to content

feat(profiling): Add Android ProfilingManager (Perfetto) support - #5251

Merged
markushi merged 49 commits into
mainfrom
claude/dreamy-solomon
Jul 29, 2026
Merged

markushi merged 49 commits into
mainfrom
claude/dreamy-solomon

Conversation

@43jay

@43jay 43jay commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

📜 Description

Adds support for Android's ProfilingManager API (API 35+), which captures continuous profiles (profile chunks) using OS-level Perfetto stack sampling instead of the legacy Debug.startMethodTracingSampling engine.

Behavior by API level:

  • API 35+ — Perfetto profiling via ProfilingManager is used automatically. No configuration needed.
  • API < 35 — the legacy Debug-based profiler is used, controlled by the new enableLegacyProfiling option.

⚙️ New options

Option Manifest key Default Description
enableLegacyProfiling io.sentry.profiling.enable-legacy-profiling true Enables the legacy Debug-based profiler on API < 35. Set to false to disable profiling on those devices. Has no effect on API 35+. Will be deprecated in the next major and removed after.

⚠️ Limitations

  • Perfetto profiling requires API 35+. On API < 35 with enableLegacyProfiling = false, no profiling data is collected (no silent fallback).
  • Only continuous profiling (profile chunks) is supported via ProfilingManager — transaction-based (legacy) profiling is unaffected.
  • App-start profiling is not supported on the Perfetto path (ProfilingManager doesn't support it).
  • Thread names may be missing in captured traces (ProfilingManager doesn't include linux.process_stats data).

💡 Motivation and Context

💚 How did you test it?

  • Unit tests
  • Manual testing on Pixel Fold AVD (API 35) — verified Perfetto chunks captured with content_type: "perfetto" and inspected in Perfetto UI.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • Review from the native team if needed.

Loading
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.

5 participants