diff --git a/docs/platforms/dart/common/feature-flags/index.mdx b/docs/platforms/dart/common/feature-flags/index.mdx new file mode 100644 index 00000000000000..7ddee825472f26 --- /dev/null +++ b/docs/platforms/dart/common/feature-flags/index.mdx @@ -0,0 +1,27 @@ +--- +title: Set Up Feature Flags +sidebar_order: 7000 +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. +--- + + + +## Prerequisites + +- [Sentry SDK](/platforms/dart/#configure) version `9.0.0`. + +## Enable Evaluation Tracking + +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: + +- [Firebase Remote Config](/platforms/dart/configuration/integrations/firebase-remote-config/) + +### Manual Usage + +Call `Sentry.addFeatureFlag` to track feature flag evaluations: + +```dart +Sentry.addFeatureFlag("feature_flag_a", true); +``` + +Calling this function multiple times with the same flag name will override the previous value. diff --git a/docs/platforms/dart/common/integrations/firebase-remote-config.mdx b/docs/platforms/dart/common/integrations/firebase-remote-config.mdx new file mode 100644 index 00000000000000..efe254bcbb7037 --- /dev/null +++ b/docs/platforms/dart/common/integrations/firebase-remote-config.mdx @@ -0,0 +1,9 @@ +--- +title: Firebase Remote Config +description: "Learn more about the Sentry Firebase Remote Config integration for the Dart SDK." +sidebar_order: 50 +redirect_from: + - /platforms/dart/guides/firebase-remote-config/ +--- + + diff --git a/docs/platforms/dart/guides/flutter/integrations/firebase-remote-config.mdx b/docs/platforms/dart/guides/flutter/integrations/firebase-remote-config.mdx new file mode 100644 index 00000000000000..5e15f4a8303728 --- /dev/null +++ b/docs/platforms/dart/guides/flutter/integrations/firebase-remote-config.mdx @@ -0,0 +1,9 @@ +--- +title: Firebase Remote Config +description: "Learn more about the Sentry Firebase Remote Config integration for the Flutter SDK." +sidebar_order: 60 +redirect_from: + - /platforms/dart/guides/flutter/firebase-remote-config/ +--- + + diff --git a/docs/platforms/javascript/common/feature-flags/index.mdx b/docs/platforms/javascript/common/feature-flags/index.mdx index e565cbb58c2714..8e2715496c27cb 100644 --- a/docs/platforms/javascript/common/feature-flags/index.mdx +++ b/docs/platforms/javascript/common/feature-flags/index.mdx @@ -21,7 +21,7 @@ notSupported: - javascript.nestjs - javascript.node - javascript.wasm -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. +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. --- diff --git a/includes/dart-integrations/firebase-remote-config.mdx b/includes/dart-integrations/firebase-remote-config.mdx new file mode 100644 index 00000000000000..f49f9d97fac2c1 --- /dev/null +++ b/includes/dart-integrations/firebase-remote-config.mdx @@ -0,0 +1,71 @@ +--- +title: Firebase Remote Config +description: "Learn more about the Sentry Firebase Remote Config integration for the Dart SDK." +sidebar_order: 6 +platforms: + - flutter +--- + +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. + +## Behavior + +- Adding the `SentryFirebaseRemoteConfig` integration will automatically track feature flag evaluations. +- Only boolean values are supported. + +## Prerequisites + +1. [Sentry SDK](/platforms/dart/#configure) version `9.0.0` or higher. +2. Firebase Remote Config is set up. + +## Install + +To use the `SentryFirebaseRemoteConfig` integration, add the `sentry_firebase_remote_config` dependency. + +```yml {filename:pubspec.yaml} +dependencies: + sentry: ^9.0.0 + sentry_firebase_remote_config: ^9.0.0 +``` + +## Configure + +Add the `SentryFirebaseRemoteConfig` integration to the Sentry SDK initialization. + +```dart +await SentryFlutter.init( + (options) { + options.addIntegration( + SentryFirebaseRemoteConfigIntegration( + firebaseRemoteConfig: firebaseRemoteConfig, + ), + ); + }, +); +``` + +### Remote Config Update + +The integration will automatically call `await remoteConfig.activate();` when the config is updated. +If you don't want this behavior, you can set `activateOnConfigUpdated` to `false`. + +```dart +SentryFirebaseRemoteConfigIntegration( + firebaseRemoteConfig: firebaseRemoteConfig, + activateOnConfigUpdated: false, +), +``` + +## Verify & View + +### 1. Update Firebase Remote Config Value + +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. + +### 2. View the Recorded Feature Flag Evaluation on Sentry.io + +To view the recorded feature flag evaluation, log into [sentry.io](https://sentry.io) and open your project. + +Flag evaluations will appear in the "Feature Flag" section of Issue Details page as a table, with "suspect" flag predictions highlighted in yellow. + +![Flag Change Suspect](./img/SuspectFlag.png) \ No newline at end of file diff --git a/includes/dart-integrations/img/SuspectFlag.png b/includes/dart-integrations/img/SuspectFlag.png new file mode 100644 index 00000000000000..67e35ac28d3d4d Binary files /dev/null and b/includes/dart-integrations/img/SuspectFlag.png differ diff --git a/includes/dart-integrations/index.mdx b/includes/dart-integrations/index.mdx index f24821dcb50304..2f58951da97080 100644 --- a/includes/dart-integrations/index.mdx +++ b/includes/dart-integrations/index.mdx @@ -14,7 +14,7 @@ | [`Slow and Frozen Frames`](/platforms/dart/guides/flutter/integrations/slow-and-frozen-frames-instrumentation) | ✓ * | | ✓ | | | [`Sqflite`](/platforms/dart/guides/flutter/integrations/sqflite-instrumentation) | | | ✓ | | | [`User Interaction`](/platforms/dart/guides/flutter/integrations/user-interaction-instrumentation) | | | ✓ | ✓ | - +| [`Firebase Remote Config`](/platforms/dart/guides/flutter/integrations/firebase-remote-config) | | | | ✓ | *Slow and Frozen Frames* should work automatically, however if `WidgetsFlutterBinding` is initialized before `SentryFlutter.init`, then this instrumentation will not work automatically. diff --git a/src/middleware.ts b/src/middleware.ts index 0ca48dcc42add2..bb859df45429f1 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -578,6 +578,10 @@ const USER_DOCS_REDIRECTS: Redirect[] = [ from: '/platforms/dart/configuration/integrations/dio/', to: '/platforms/dart/integrations/dio/', }, + { + from: '/platforms/dart/configuration/integrations/firebase-remote-config/', + to: '/platforms/dart/integrations/firebase-remote-config/', + }, { from: '/quickstart/', to: '/platforms/',