Commit 914ebff
authored
feat: accounts telemetry (#37375)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
This PR adds tracing to the following actions:
1. Show Account List
2. Show Account Private Key List
3. Create Multichain Account
4. Discover Accounts
5. Show Account Address List
6. EVM Discover Accounts
7. Snap Discover Accounts
8. Select Account
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
9. What is the improvement/solution?
-->
[](https://codespaces.new/MetaMask/metamask-extension/pull/37375?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: null
## **Related issues**
Fixes:
https://consensyssoftware.atlassian.net/browse/MUL-1186?atlOrigin=eyJpIjoiOTg3NjBhM2ZlYTAzNGI4Y2EyZGI4MjVlNjQzMjQ5ZWQiLCJwIjoiaiJ9
## **Manual testing steps**
In `.metamaskrc` add your own sentry code
Example:
```SENTRY_DSN_DEV=<link>```
Test the different flows:
- Open a the account list
- Open the address list
- Reveal the private key from the account details
- Import a new srp
- Create a new account
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. -->
### **Before**
N/a
### **After**
N/a
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable
- [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds Sentry trace instrumentation for multichain account flows (list, addresses, private keys, creation, discovery) across background and UI, with comprehensive tests.
>
> - **Trace Library**:
> - Add new `TraceName` and `TraceOperation` entries for accounts (`ShowAccountList`, `ShowAccountAddressList`, `ShowAccountPrivateKeyList`, `CreateMultichainAccount`, `DiscoverAccounts`, `EvmDiscoverAccounts`, `AccountList`, `AccountCreate`, `AccountUi`, `AccountDiscover`).
> - **Background/Services**:
> - Inject `trace` into `MultichainAccountService` config.
> - Instrument `discoverAndCreateAccounts` and `_addAccountsWithBalance` with `trace`/`endTrace`, including nested `EvmDiscoverAccounts` span and guaranteed `finally` endings.
> - **UI**:
> - Add traces on key user actions:
> - Account picker opens account list; end traces on `MultichainAccountList` mount.
> - Account menu “Addresses” navigation.
> - Address hover list “View all” via new `onViewAllClick` prop.
> - Address list page ends `ShowAccountAddressList` on mount.
> - Private key list traces around reveal flow and ends on reveal.
> - Add account button traces around create flow.
> - Account details “Networks” link traces before navigation.
> - **Tests**:
> - Extensive unit tests updated/added to assert trace start/end calls and navigation; minor mock fixes (e.g., `getPlatformInfo` return shape).
>
> <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 834eaf1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 85a6242 commit 914ebff
File tree
21 files changed
+772
-64
lines changed- app/scripts
- controller-init/multichain
- ui
- components
- multichain-accounts
- add-multichain-account
- multichain-account-list
- multichain-address-rows-hovered-list
- multichain-private-key-list
- multichain/app-header
- pages/multichain-accounts
- multichain-account-address-list-page
- multichain-account-details-page
21 files changed
+772
-64
lines changedLines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4527 | 4527 | | |
4528 | 4528 | | |
4529 | 4529 | | |
| 4530 | + | |
| 4531 | + | |
| 4532 | + | |
| 4533 | + | |
4530 | 4534 | | |
4531 | 4535 | | |
4532 | 4536 | | |
| |||
4556 | 4560 | | |
4557 | 4561 | | |
4558 | 4562 | | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
4559 | 4567 | | |
4560 | 4568 | | |
4561 | 4569 | | |
| |||
4949 | 4957 | | |
4950 | 4958 | | |
4951 | 4959 | | |
| 4960 | + | |
| 4961 | + | |
| 4962 | + | |
| 4963 | + | |
4952 | 4964 | | |
4953 | 4965 | | |
4954 | 4966 | | |
| |||
4970 | 4982 | | |
4971 | 4983 | | |
4972 | 4984 | | |
4973 | | - | |
4974 | | - | |
4975 | | - | |
4976 | | - | |
4977 | | - | |
4978 | | - | |
4979 | | - | |
4980 | | - | |
4981 | | - | |
| 4985 | + | |
| 4986 | + | |
| 4987 | + | |
| 4988 | + | |
| 4989 | + | |
| 4990 | + | |
| 4991 | + | |
| 4992 | + | |
| 4993 | + | |
| 4994 | + | |
| 4995 | + | |
| 4996 | + | |
| 4997 | + | |
| 4998 | + | |
4982 | 4999 | | |
4983 | | - | |
4984 | | - | |
4985 | | - | |
4986 | | - | |
| 5000 | + | |
| 5001 | + | |
| 5002 | + | |
| 5003 | + | |
| 5004 | + | |
| 5005 | + | |
4987 | 5006 | | |
4988 | | - | |
4989 | | - | |
4990 | | - | |
4991 | | - | |
4992 | | - | |
4993 | | - | |
4994 | | - | |
| 5007 | + | |
| 5008 | + | |
| 5009 | + | |
| 5010 | + | |
| 5011 | + | |
| 5012 | + | |
| 5013 | + | |
| 5014 | + | |
| 5015 | + | |
4995 | 5016 | | |
4996 | | - | |
4997 | 5017 | | |
4998 | | - | |
4999 | 5018 | | |
5000 | | - | |
5001 | | - | |
5002 | | - | |
5003 | | - | |
5004 | | - | |
5005 | | - | |
5006 | | - | |
5007 | | - | |
| 5019 | + | |
| 5020 | + | |
| 5021 | + | |
| 5022 | + | |
| 5023 | + | |
| 5024 | + | |
| 5025 | + | |
| 5026 | + | |
| 5027 | + | |
| 5028 | + | |
| 5029 | + | |
| 5030 | + | |
| 5031 | + | |
| 5032 | + | |
5008 | 5033 | | |
5009 | 5034 | | |
5010 | 5035 | | |
| |||
5081 | 5106 | | |
5082 | 5107 | | |
5083 | 5108 | | |
| 5109 | + | |
| 5110 | + | |
| 5111 | + | |
| 5112 | + | |
| 5113 | + | |
5084 | 5114 | | |
5085 | 5115 | | |
5086 | 5116 | | |
| |||
0 commit comments