Skip to content

Commit bb0206b

Browse files
committed
update
1 parent a024bb3 commit bb0206b

File tree

1 file changed

+22
-39
lines changed

1 file changed

+22
-39
lines changed

docs/platforms/flutter/integrations/app-start-instrumentation.mdx

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,27 @@ categories:
1010

1111
Sentry's app start instrumentation provides insight into how long your application takes to launch.
1212

13+
<Note>
14+
15+
App start instrumentation is available on **iOS** and **Android**.
16+
17+
</Note>
18+
1319
## Instrumentation Behaviour
1420

1521
Before diving into the configuration, it's important to understand how app start instrumentation behaves:
1622

17-
- The SDK attaches the app start metrics to the **first run transaction**.
18-
- It tracks the length of time from the **earliest native process initialization** until the very first [PostFrameCallback](https://api.flutter.dev/flutter/scheduler/SchedulerBinding/addPostFrameCallback.html) is triggered.
19-
- The SDK differentiates between a cold and a warm start, but doesn't track hot starts/resumes.
23+
- It tracks the length of time from the **earliest native process initialization** until the very first frame rendered that is reported by [addTimingsCallback](https://api.flutter.dev/flutter/scheduler/SchedulerBinding/addTimingsCallback.html). Once the app start is processed, the SDK removes the callback in order to avoid additional overhead.
24+
- After receiving information about the start and end times of the app launch, the SDK does the following:
25+
- creates a transaction with the name `ui.load`
26+
- in the transaction attaches a span with the operation `app.start.cold` or `app.start.warm`
27+
- attaches the app start metrics to the transaction
28+
29+
<Note>
30+
31+
The SDK differentiates between a cold and a warm start, but doesn't track hot starts/resumes.
32+
33+
</Note>
2034

2135
## Prerequisites
2236

@@ -27,49 +41,18 @@ Before starting, ensure:
2741

2842
## Configure
2943

30-
This type of instrumentation is automatically enabled. There is no need for further configuration.
44+
This instrumentation is automatically enabled. There is no need for further configuration.
3145

3246
## Verify
3347

34-
### 1. Execute the Transaction:
35-
36-
Initiate a transaction immediately after the app launches.
37-
38-
```dart
39-
import 'package:sentry/sentry.dart';
48+
### 1. Launch your app:
4049

41-
final transaction = Sentry.startTransaction("test test", "my operation");
42-
await Future.delayed(const Duration(milliseconds: 1000));
43-
transaction.finish();
44-
```
50+
Launch your Sentry configured app.
4551

4652
### 2. Locate Your Transaction:
4753

48-
Open the [sentry.io](https://sentry.io/) performance dashboard, find, and select the transaction you executed.
54+
Open the [sentry.io](https://sentry.io/) performance dashboard, find, and select the 'root /' transaction.
4955

5056
### 3. View App Start Metrics:
5157

52-
Select the event within your transaction. Sentry.io displays the app start metrics on the right side of the screen.
53-
54-
## Additional Configuration
55-
56-
### Change App Start Tracking End
57-
58-
1. Set `autoAppStart` to `false` in the Sentry options.
59-
2. Call `SentryFlutter.setAppStartEnd`.
60-
61-
```dart
62-
import 'package:sentry_flutter/sentry_flutter.dart';
63-
64-
// Run my App and do my things first
65-
66-
// Initialize the Flutter SDK
67-
Future<void> main() async {
68-
await SentryFlutter.init(
69-
(options) => options.autoAppStart = false,
70-
);
71-
}
72-
73-
// End the App Start metric
74-
SentryFlutter.setAppStartEnd(DateTime.now().toUtc());
75-
```
58+
Select the event within your transaction. Sentry.io displays the app start metrics on the right side of the screen in the **Mobile Vitals** section.

0 commit comments

Comments
 (0)