Skip to content

Commit 2408302

Browse files
denrasebuenaflormichellewzhang
authored andcommitted
docs(dart): Add feature flags documentation (#13391)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Adds docs for Flutter Feature Flag implementation, which will be available in the upcoming v9 release. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## EXTRA RESOURCES - [ [Flutter] Feature Flags Reporting](getsentry/sentry-dart#2746) --------- Co-authored-by: Giancarlo Buenaflor <giancarlo_buenaflor@yahoo.com> Co-authored-by: Michelle Zhang <56095982+michellewzhang@users.noreply.github.com>
1 parent 4c91830 commit 2408302

File tree

8 files changed

+122
-2
lines changed

8 files changed

+122
-2
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Set Up Feature Flags
3+
sidebar_order: 7000
4+
description: With Feature Flags, Sentry tracks feature flag evaluations in your application, keeps an audit log of feature flag changes, and reports any suspicious updates that may have caused an error.
5+
---
6+
7+
<PlatformContent includePath="feature-flags/prerelease-alert" />
8+
9+
## Prerequisites
10+
11+
- [Sentry SDK](/platforms/dart/#configure) version `9.0.0`.
12+
13+
## Enable Evaluation Tracking
14+
15+
If you use a third-party SDK to evaluate feature flags, you can enable Sentry to track those evaluations. Integrations are provider specific, and documentation for supported SDKs is listed below:
16+
17+
- [Firebase Remote Config](/platforms/dart/configuration/integrations/firebase-remote-config/)
18+
19+
### Manual Usage
20+
21+
Call `Sentry.addFeatureFlag` to track feature flag evaluations:
22+
23+
```dart
24+
Sentry.addFeatureFlag("feature_flag_a", true);
25+
```
26+
27+
Calling this function multiple times with the same flag name will override the previous value.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Firebase Remote Config
3+
description: "Learn more about the Sentry Firebase Remote Config integration for the Dart SDK."
4+
sidebar_order: 50
5+
redirect_from:
6+
- /platforms/dart/guides/firebase-remote-config/
7+
---
8+
9+
<Include name="dart-integrations/firebase-remote-config.mdx" />
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Firebase Remote Config
3+
description: "Learn more about the Sentry Firebase Remote Config integration for the Flutter SDK."
4+
sidebar_order: 60
5+
redirect_from:
6+
- /platforms/dart/guides/flutter/firebase-remote-config/
7+
---
8+
9+
<Include name="dart-integrations/firebase-remote-config.mdx" />

docs/platforms/javascript/common/feature-flags/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ notSupported:
2121
- javascript.nestjs
2222
- javascript.node
2323
- javascript.wasm
24-
description: With Feature Flags, Sentry tracks feature flag evaluations in your application, keeps an audit log feature flag changes, and reports any suspicious updates that may have caused an error.
24+
description: With Feature Flags, Sentry tracks feature flag evaluations in your application, keeps an audit log of feature flag changes, and reports any suspicious updates that may have caused an error.
2525
---
2626

2727
<PlatformContent includePath="feature-flags/prerelease-alert" />
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: Firebase Remote Config
3+
description: "Learn more about the Sentry Firebase Remote Config integration for the Dart SDK."
4+
sidebar_order: 6
5+
platforms:
6+
- flutter
7+
---
8+
9+
The `sentry_firebase_remote_config` integration provides [Firebase Remote Config](https://firebase.google.com/docs/remote-config/get-started?platform=flutter) support for Sentry, providing insight into feature flag evaluations.
10+
11+
## Behavior
12+
13+
- Adding the `SentryFirebaseRemoteConfig` integration will automatically track feature flag evaluations.
14+
- Only boolean values are supported.
15+
16+
## Prerequisites
17+
18+
1. [Sentry SDK](/platforms/dart/#configure) version `9.0.0` or higher.
19+
2. Firebase Remote Config is set up.
20+
21+
## Install
22+
23+
To use the `SentryFirebaseRemoteConfig` integration, add the `sentry_firebase_remote_config` dependency.
24+
25+
```yml {filename:pubspec.yaml}
26+
dependencies:
27+
sentry: ^9.0.0
28+
sentry_firebase_remote_config: ^9.0.0
29+
```
30+
31+
## Configure
32+
33+
Add the `SentryFirebaseRemoteConfig` integration to the Sentry SDK initialization.
34+
35+
```dart
36+
await SentryFlutter.init(
37+
(options) {
38+
options.addIntegration(
39+
SentryFirebaseRemoteConfigIntegration(
40+
firebaseRemoteConfig: firebaseRemoteConfig,
41+
),
42+
);
43+
},
44+
);
45+
```
46+
47+
### Remote Config Update
48+
49+
The integration will automatically call `await remoteConfig.activate();` when the config is updated.
50+
If you don't want this behavior, you can set `activateOnConfigUpdated` to `false`.
51+
52+
```dart
53+
SentryFirebaseRemoteConfigIntegration(
54+
firebaseRemoteConfig: firebaseRemoteConfig,
55+
activateOnConfigUpdated: false,
56+
),
57+
```
58+
59+
## Verify & View
60+
61+
### 1. Update Firebase Remote Config Value
62+
63+
Update a boolean [Firebase Remote Config](https://firebase.google.com/docs/remote-config/get-started?platform=flutter) value to true. Keep in mind that values will be evaluated as bool if their string values are `true`, `false`, `1`, or `0`. So numerical values of `1` or `0` will be evaluated as `true` or `false` boolean values respectively.
64+
65+
### 2. View the Recorded Feature Flag Evaluation on Sentry.io
66+
67+
To view the recorded feature flag evaluation, log into [sentry.io](https://sentry.io) and open your project.
68+
69+
Flag evaluations will appear in the "Feature Flag" section of Issue Details page as a table, with "suspect" flag predictions highlighted in yellow.
70+
71+
![Flag Change Suspect](./img/SuspectFlag.png)
121 KB
Loading

includes/dart-integrations/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| [`Slow and Frozen Frames`](/platforms/dart/guides/flutter/integrations/slow-and-frozen-frames-instrumentation) | ✓ * | || |
1515
| [`Sqflite`](/platforms/dart/guides/flutter/integrations/sqflite-instrumentation) | | || |
1616
| [`User Interaction`](/platforms/dart/guides/flutter/integrations/user-interaction-instrumentation) | | |||
17-
17+
| [`Firebase Remote Config`](/platforms/dart/guides/flutter/integrations/firebase-remote-config) | | | ||
1818
<Alert>
1919

2020
*Slow and Frozen Frames* should work automatically, however if `WidgetsFlutterBinding` is initialized before `SentryFlutter.init`, then this instrumentation will not work automatically.

src/middleware.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,10 @@ const USER_DOCS_REDIRECTS: Redirect[] = [
578578
from: '/platforms/dart/configuration/integrations/dio/',
579579
to: '/platforms/dart/integrations/dio/',
580580
},
581+
{
582+
from: '/platforms/dart/configuration/integrations/firebase-remote-config/',
583+
to: '/platforms/dart/integrations/firebase-remote-config/',
584+
},
581585
{
582586
from: '/quickstart/',
583587
to: '/platforms/',

0 commit comments

Comments
 (0)