You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[analytics] Update devtools to set analytics ENV variables when invoking sub-tools #9702
Some quick notes on how DevTools currently handles analytics. From my understanding, DevTools is currently only a sub-tool (since it is spawned by other tools), and has no sub-tools itself (since it doesn't spawn any tools).
How DevTools determines whether or not send analytics:
isAnalyticsEnabled: Called once when DevTools first loads. Checks whether a user has opted into either unified or legacy analytics collection.
unified analytics: DTD checks whether analytics collection is enabled in the unified_analytics config on disk
legacy: DevTools checks whether analytics collection is enabled in the devtools config on disk
How DevTools determines its parent tool:
If DevTools is embedded in an IDE, the IDE sets the ide query parameter, which then is included in the analytics (if ide is null, we assume DevTools was opened by the user from the URL provided by the Dart/Flutter CLI)
Thinking about this some more, I realize we only looked at half the issue and weren't accounting for the places where devtools itself calls out to sub-tools (and should in turn flow env variables down to them).
Gemini did a round-up for me (included below). A bunch can be ignored (for example shell commands and test infrastructure) but we should look at the flutter tool calls ay least.
Activity
elliette commentedon Apr 6, 2026
Some quick notes on how DevTools currently handles analytics. From my understanding, DevTools is currently only a sub-tool (since it is spawned by other tools), and has no sub-tools itself (since it doesn't spawn any tools).
How DevTools determines whether or not send analytics:
isAnalyticsEnabled: Called once when DevTools first loads. Checks whether a user has opted into either unified or legacy analytics collection.unified_analyticsconfig on diskdevtoolsconfig on diskHow DevTools determines its parent tool:
idequery parameter, which then is included in the analytics (ifideisnull, we assume DevTools was opened by the user from the URL provided by the Dart/Flutter CLI)kenzieschmoll commentedon Apr 21, 2026
Is there any work that actually needs to be done here based on @elliette's comment?
pq commentedon May 18, 2026
Sorry for the slow reply. I think this is WAI so we're good to go. Thanks for the thoughtful context @elliette !
pq commentedon May 19, 2026
Thinking about this some more, I realize we only looked at half the issue and weren't accounting for the places where
devtoolsitself calls out to sub-tools (and should in turn flow env variables down to them).Gemini did a round-up for me (included below). A bunch can be ignored (for example shell commands and test infrastructure) but we should look at the
fluttertool calls ay least.Spawning in Production Code
DeeplinkManagerpackages/devtools_shared/lib/src/deeplink/deeplink_manager.dartflutterbinary viaProcess.runto analyze deep links (e.g.,--list-build-variants,--output-app-link-settings,--list-build-options).Spawning in DevTools Extension Building / Tooling
BuildExtensionCommandpackages/devtools_extensions/bin/_build_and_copy.dartflutter build webandchmodviaProcessManagerwhen preparing/packaging extensions.tool/lib/commands/rollback.darttarviaProcess.runto handle rollbacks.tool/lib/commands/release_helper.dartgitcommands.tool/lib/model.dart&tool/lib/utils.dartwhich flutterand other scripting subprocesses.Spawning in Test Infrastructure
packages/devtools_shared/lib/src/test/chrome.dart(Starts Chrome browser)packages/devtools_shared/lib/src/test/chrome_driver.dart(Starts Chromedriver)packages/devtools_shared/lib/src/test/integration_test_runner.dartpackages/devtools_shared/lib/src/test/cli_test_driver.dartpackages/devtools_shared/test/helpers/helpers.dart(Starts DTD test instances)packages/devtools_shared/test/helpers/extension_test_manager.dartpackages/devtools_app/test/test_infra/flutter_test_driver.dart(Starts Flutter test driver processes)packages/devtools_app/integration_test/test_infra/run/run_test.dart(Starts DevTools server for integration tests)packages/devtools_app/integration_test/test_infra/run/_test_app_driver.dart