sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Add support for Firebase Remote Config Feature Flags

Open adinauer opened this issue 1 month ago • 1 comments

Problem Statement

Add a hook for Firebase Remote Config that tracks Feature Flag evaluations in Sentry.

Solution Brainstorm

Something like:

public class SentryFirebaseRemoteConfigListener implements ConfigUpdateListener {
  private final IScopes scopes;
  private final FirebaseRemoteConfig remoteConfig;
  
  @Override
  public void onUpdate(ConfigUpdate configUpdate) {
    // Track all boolean flags that were updated
    Set<String> updatedKeys = configUpdate.getUpdatedKeys();
    for (String key : updatedKeys) {
      try {
        boolean value = remoteConfig.getBoolean(key);
        scopes.addFeatureFlag(key, value);
      } catch (Exception e) {
        // Log error, don't break
      }
    }
  }
  
  @Override
  public void onError(ConfigUpdateException error) {
    // Log error but don't track as feature flag
  }
}

Also look at what Flutter SDK is doing: https://github.com/getsentry/sentry-dart/blob/main/packages/firebase_remote_config/lib/src/sentry_firebase_remote_config_integration.dart

Please 👍 if you would like us to implement this.

adinauer avatar Dec 01 '25 12:12 adinauer

JAVA-259

linear[bot] avatar Dec 01 '25 12:12 linear[bot]