Move Snap export metrics to SnapController
Right now we collect metrics about Snap export usage directly in the clients, but this means we are missing out on all calls that go directly between controllers. We should move the metrics to the controller itself.
Additionally, we should audit what specific exports we want to track since we've added a bunch since we implemented metrics.
From Christian:
Exports should be:
- onHomePage
- onInstall
- onNameLookup
- onRpcRequest
- onSignature
- onTransaction
- onUpdate
Others do not make sense to track as they do not involve the user viewing / interacting with a page or dialog (and onUserInput would generate a lot of data that wouldn’t be useful either). And definitely debounce onNameLookup, we don’t need to collect every instance
Done and fully integrated with following release PRs: https://github.com/MetaMask/metamask-extension/pull/32744 https://github.com/MetaMask/metamask-mobile/pull/15232