---
title: "Profiling"
description: "Learn how to enable profiling in your app if it is not already set up."
url: https://docs.sentry.io/platforms/dart/guides/flutter/profiling/
---

# Set Up Profiling | Sentry for Flutter

With [profiling](https://docs.sentry.io/product/explore/profiling.md), Sentry tracks your software's performance by sampling your program's call stack in a variety of environments. This feature collects function-level information about your code and enables you to fine-tune your program's performance. [Sentry's profiler](https://sentry.io/for/profiling/) captures function calls and their exact locations, aggregates them, and shows you the most common code paths of your program. This highlights areas you could optimize to help increase both the performance of your code and increase user satisfaction, as well as drive down costs.

The profiling feature captures profiles across multiple language layers, including native languages (such as Swift and Objective-C) as well as Dart.

Flutter Profiling is currently in Alpha and available only for **iOS** and **macOS**, requiring SDK version 7.12.0 or later.

## [Enable Tracing](https://docs.sentry.io/platforms/dart/guides/flutter/profiling.md#enable-tracing)

Profiling depends on Sentry’s Tracing product being enabled beforehand. To enable tracing in the SDK:

```dart
SentryFlutter.init(
  (options) => {
    options.dsn = '___PUBLIC_DSN___';
+   // We recommend adjusting this value in production:
+   options.tracesSampleRate = 1.0;
  },
  appRunner: () => runApp(MyApp()),
);
```

Check out the [tracing setup documentation](https://docs.sentry.io/platforms/dart/guides/flutter/tracing.md) for more detailed information on how to configure sampling. Setting the sample rate to 1.0 means all transactions will be captured.

## [Enable Profiling](https://docs.sentry.io/platforms/dart/guides/flutter/profiling.md#enable-profiling)

To enable profiling, set the `profilesSampleRate`:

```dart
SentryFlutter.init(
  (options) => {
    options.dsn = '___PUBLIC_DSN___';
    // We recommend adjusting this value in production:
    options.tracesSampleRate = 1.0;
+   // The sampling rate for profiling is relative to tracesSampleRate
+   // Setting to 1.0 will profile 100% of sampled transactions:
+   options.profilesSampleRate = 1.0;
  },
  appRunner: () => runApp(MyApp()),
);
```

## Pages in this section

- [Troubleshooting](https://docs.sentry.io/platforms/dart/guides/flutter/profiling/troubleshooting.md)
