@@ -20,6 +20,7 @@ import '../extensions/extension_service.dart';
2020import '../screens/debugger/breakpoint_manager.dart' ;
2121import '../service/service_manager.dart' ;
2222import '../service/vm_service_wrapper.dart' ;
23+ import '../shared/analytics/analytics.dart' as ga;
2324import '../shared/config_specific/framework_initialize/framework_initialize.dart' ;
2425import '../shared/console/eval/eval_service.dart' ;
2526import '../shared/feature_flags.dart' ;
@@ -56,6 +57,17 @@ abstract class FrameworkCore {
5657
5758 await initializePlatform ();
5859
60+ // Initialize analytics metrics before initializing the rest of the
61+ // framework. It is important that this method call is here, after the
62+ // `storage` global variable has been set by the `initializePlatform` call,
63+ // since the analytics dimensions reference the `storage` global. We
64+ // initialize this now so that any analytics events sent from here on our
65+ // include the expected metadata.
66+ // TODO(kenz): consider making the dimensions that need initialization
67+ // `late` so that they can be initialized on first access rather than
68+ // manually.
69+ await ga.setupDimensions ();
70+
5971 // Print DevTools info at startup.
6072 _log.info (
6173 'Version: $devToolsVersion , Renderer: ${kIsWasm ? 'skwasm' : 'canvaskit' }' ,
0 commit comments