Skip to content

Continuous Profiling for Dart/Flutter (iOS/Android) #3890

Description

@buenaflor

If you relied on profiling in the Flutter SDK, or want continuous profiling support, please: 👍 this issue

Background

Sentry Flutter v10 removes the iOS/macOS alpha profiling support. The previous implementation was transaction-based profiling, which is a legacy approach that Sentry is moving away from across all SDKs. Its designated successor is Continuous Profiling, which is not yet available in the Flutter SDK.

This issue tracks demand for bringing Continuous Profiling to Dart/Flutter and serves as the central place for affected users to weigh in.

Why is transaction-based profiling being removed in v10?

  • Profiles were bound to a transaction's lifetime, limiting visibility into long-running sessions, app startup, and issues outside of transactions
  • The legacy implementation is deprecated across Sentry SDKs in favor of continuous profiling

What Continuous Profiling would offer

Profiles captured across the entire app session rather than per-transaction

Sentry already ships (or is actively building) this on the native platforms:

  • Cocoa (iOS): UI Profiling
  • Android: Perfetto-based profiling (in progress)

Profiling Dart Code

In Flutter Profile/Release builds, Dart code is AOT-compiled into native machine instruction, so it executes as regular native code. Thus both Cocoa and Android (Perfetto) profiler should allow us to have insight into Dart frames.

Android

Depends on the upcoming Android Perfetto profiling support so this is blocked.

Cocoa

I did small experiments with Cocoa's UI profiling and updating some of the internal profiling implementations it's possible to also capture Dart frames by relaxing the unwinder's frame-pointer validation checks that were prematurely terminating the stack walk. - it just needs to follow the full frame chain instead of stopping too early. (performance impact TBD but tests show it's not a lot)

Example of a Cocoa profile that captures a 5 second app hang from the function hangMainIsolate:

Image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions