# firebase performance monitoring

Source:  [https://firebase.google.com/docs/flutter/setup?platform=ios](https://firebase.google.com/docs/flutter/setup?platform=ios)

Pre-requisite: Get access to Firebase console

Then Install the command line tools

\&gt; [install the Firebase CLI](https://firebase.google.com/docs/cli#setup_update_cli).

```bash
> firebase login

> dart pub global activate flutterfire_cli

#Configure app to use firebase

> flutterfire configure

This will add firebase_options.dart under /lib Contains all properties to push metrics
```

Initialize Firebase in App

```bash
flutter pub add firebase_core

In my_app.dart / main.dart

import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';

await Firebase.initializeApp(
  options: DefaultFirebaseOptions.currentPlatform,
);

flutter run -v lib/main.dart    
```

Adding plugin

```bash
flutter pub add firebase_performance
 
flutterfire configure
flutter run
```

## Default metrics

Following above steps, we see some metrics in Firebase console. 

Attributes pushed include - 

* [App start trace](https://firebase.google.com/docs/perf-mon/app-start-foreground-background-traces?platform=ios#app-start) — A trace that measures the time between when the user opens the app and when the app is responsive
    
* [App-in-foreground trace](https://firebase.google.com/docs/perf-mon/app-start-foreground-background-traces?platform=ios#app-in-foreground) — A trace that measures the time when the app is running in the foreground and available to the user
    
* [App-in-background trace](https://firebase.google.com/docs/perf-mon/app-start-foreground-background-traces?platform=ios#app-in-background) — A trace that measures the time when the app is running in the background
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1731515249763/df99f84b-ddc2-44c6-b529-24a99e733705.png align="center")
