Skip to content

feat: set Sentry user id#40491

Merged
gauthierpetetin merged 21 commits into
mainfrom
feat/sentry-metametrics-user-id-3
Apr 2, 2026
Merged

feat: set Sentry user id#40491
gauthierpetetin merged 21 commits into
mainfrom
feat/sentry-metametrics-user-id-3

Conversation

@gauthierpetetin

@gauthierpetetin gauthierpetetin commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Description

Problem we're trying to solve:

Today, when we see 100 events in Sentry , we don't know if the issue occurred 100x to the same user VS to 100 different users.

Solution:

This PR sets a userId in Sentry events. Setting a userId in Sentry will allow us to know the number of users impacted by given issue.

We decided to use metaMetricsId for it, as it's kind of an "installationId" that allows to identify a MM instance: it's unique for every MM instance.

Additionally, we did some refactoring.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: null

Related issues

Fixes: https://github.com/MetaMask/MetaMask-planning/issues/1753

Manual testing steps

  1. Update SENTRY_DSN_DEV .metamaskrc file with the DSN of your personal Sentry
  2. Start Extension with yarn start
  3. Open the browser console on the MetaMask UI page (not the site you’re browsing) and execute the following script:
// Run in the MetaMask fullscreen UI console. MetaMetrics on, SENTRY_DSN_DEV set.

const tag = `batch-${Date.now()}`;
const sampleUrl = 'http://example.com/path';
const sampleAddr = '0x790A8A9E9bc1C9dB991D8721a92e461Db4CfB235';

// Expect in Sentry: 5 UI issues/events, messages like "[tag] UI 0" … "UI 4" (distinct by index).
for (let i = 0; i < 5; i++) {
  window.stateHooks.captureTestError?.(`[${tag}] UI ${i}`);
}

// Expect in Sentry: 5 background issues/events, messages like "[tag] BG 0" … "BG 4".
for (let i = 0; i < 5; i++) {
  window.stateHooks.captureBackgroundError?.(`[${tag}] BG ${i}`);
}

// Expect: message shows ** instead of the http URL, and 0x** instead of the full address (sanitized).
window.stateHooks.captureTestError?.(
  `[${tag}] SAN-UI url+addr fail at ${sampleUrl} holder ${sampleAddr}`,
);

// Expect: same sanitization as SAN-UI (URL → **, long 0x address → 0x**), from background context.
window.stateHooks.captureBackgroundError?.(
  `[${tag}] SAN-BG url+addr fail at ${sampleUrl} holder ${sampleAddr}`,
);

// Expect: https://codefi.network/ still visible (allowlisted); the trailing bad URL still → **.
window.stateHooks.captureTestError?.(
  `[${tag}] SAN-UI allowed https://codefi.network/ next to bad ${sampleUrl}`,
);
  1. Go to Sentry UI and confirm you see 13 issues:
1 Overview
  1. Confirm the error messages show ** instead of http URLs (except for allowlisted url like https://codefi.network/)
  2. Confirm the error messages show 0x** instead of full Ethereum addresses
  3. Confirm the userId is set and corresponds to your metametricsId:
Screenshot 2026-02-17 at 10 18 19
  1. Open the browser console on the MetaMask UI page (not the site you’re browsing) and execute the following script:
const identicalUiMessage =
  '[dedupe-test-ui] identical TestError for dedupeIntegration check';

// Expect: ideally 1 event sent to Sentry from this loop (9 dropped as dupes of the prior).
for (let i = 0; i < 10; i++) {
  window.stateHooks.captureTestError?.(identicalUiMessage);
}
  1. Go to Sentry UI and confirm you see 1 issue (and not 10)

Screenshots/Recordings

See Manual testing steps section

Pre-merge author checklist

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.

Note

Medium Risk
Changes Sentry event processing and transport gating based on MetaMetrics opt-in state, which could affect whether errors/sessions are reported and how users are identified. Risk is mitigated by added unit tests, but regressions could reduce observability if state resolution fails.

Overview
Sentry events now include a stable user identifier by attaching event.user.id from metaMetricsId when MetaMetrics is opted in.

Refactors MetaMetrics opt-in resolution into new sentry-get-state helpers (snapshot → persisted → backup fallback) and replaces the old filterEvents integration with a new metaMetricsIntegration plus a dedicated makeTransport that blocks all Sentry network requests when opted out.

Updates beforeBreadcrumb to use the new participation state, adjusts globals typing (stateHooks.getBackupState?, globalThis.sentry no longer extended), and adds comprehensive unit tests for state resolution, transport behavior, and the new integration.

Written by Cursor Bugbot for commit 8ac6e1e. This will update automatically on new commits. Configure here.

- Move event gating and rewrite into custom transport (getMetaMetricsState + rewriteReport)
- Remove beforeSend, filterEvents integration, and sentry-filter-events.ts
- Remove getMetaMetricsEnabled; use getMetaMetricsState with participateInMetaMetrics and metaMetricsId
- Update tests for rewriteReport(report, state) and add makeTransport tests
- Simplify global types: sentry is Sentry | undefined (drop SentryObject)

Made-with: Cursor
@github-actions

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Comment thread app/scripts/lib/setupSentry.js Outdated
@metamaskbotv2

metamaskbotv2 Bot commented Feb 27, 2026

Copy link
Copy Markdown
Contributor
Builds ready [5755578]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account381264548116491548
total381264548116491548
Confirm Txconfirm_tx6055602260973260916097
total6055602260973260916097
Bridge User Actionsbridge_load_page26123528117278281
bridge_load_asset_picker14312516214150162
bridge_search_token7077067070707707
total110611001113511051113
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14171218184410914421638
load1188101314939212141381
domContentLoaded118199114899212081368
domInteractive291799182579
firstPaint1457135761198235
backgroundConnect21019429615213239
firstReactRender20135272138
initialActions106124
loadScripts98779412869110141160
setupStore1363151623
numNetworkReqs312290202386
Power User HomeuiStartup3450159510567219340229807
load12711050172913213171584
domContentLoaded12511042165412212901539
domInteractive3519145253291
firstPaint215771431152278346
backgroundConnect16332568786195422727379
firstReactRender24174462636
initialActions109115
loadScripts1037854143611810641327
setupStore1765081833
numNetworkReqs87441501999114
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2192172212220221
srpButtonToSrpForm91909319293
confirmSrpToPwForm21212102121
pwFormToMetricsScreen16141711617
metricsToWalletReadyScreen16151601616
doneButtonToHomeScreen1105693157431112131574
openAccountMenuToAccountListLoaded74517200783530478117835
total89208773913713990099137
Onboarding New WalletcreateWalletToSocialScreen2222212231223223
srpButtonToPwForm1071051092108109
createPwToRecoveryScreen989099
skipBackupToMetricsScreen37354023940
agreeButtonToOnboardingSuccess17171811818
doneButtonToAssetList1066641141830213241418
total14591031180730117111807
Asset DetailsassetClickToPriceChart564469106569
total564469106569
Solana Asset DetailsassetClickToPriceChart48465024950
total48465024950
Import Srp HomeloginToHomeScreen1996189520937020072093
openAccountMenuAfterLogin43364754747
homeAfterImportWithNewWallet24682175276223326022762
total45914111505233548165052
Send TransactionsopenSendPageFromHome301839103939
selectTokenToSendFormLoaded22212512225
reviewTransactionToConfirmationPage86084787211871872
total91588893117930931
SwapopenSwapPageFromHome14212216315156163
fetchAndDisplaySwapQuotes4681457147658047494765
total4820469349279348904927
🌐 Dapp Page Load Benchmarks

Current Commit: 5755578 | Date: 2/27/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±42ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 729ms (±39ms) 🟢 | historical mean value: 732ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 80ms (±14ms) 🟢 | historical mean value: 83ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 42ms 1.01s 1.34s 1.06s 1.34s
domContentLoaded 729ms 39ms 707ms 1.01s 756ms 1.01s
firstPaint 80ms 14ms 64ms 204ms 92ms 204ms
firstContentfulPaint 80ms 14ms 64ms 204ms 92ms 204ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 57 Bytes (0%)
  • common: 1.02 KiB (0.01%)

@gauthierpetetin gauthierpetetin marked this pull request as draft February 27, 2026 15:56
… tests

- Export getMetaMetricsStateFromAppState, getMetaMetricsStateFromPersistedState, getMetaMetricsStateFromBackupState
- Add unit tests for state getters and makeTransport paths (app state, backup, failures)
- Use defaultMetaMetricsState with test-metrics-id for rewriteReport cases

Made-with: Cursor
@metamaskbotv2

metamaskbotv2 Bot commented Mar 18, 2026

Copy link
Copy Markdown
Contributor
Builds ready [6242c6e]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account29926935030315350
total29926935030315350
Confirm Txconfirm_tx6068603261203560786120
total6068603261203560786120
Bridge User Actionsbridge_load_page25318628938287289
bridge_load_asset_picker22215128651258286
bridge_search_token74070976520755765
total1216112213167112741316
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Standard HomeuiStartup14841232191211215541661
load12301016159710512941397
domContentLoaded12251011157210412891390
domInteractive3118119212785
firstPaint162751280136201306
backgroundConnect21819732515224236
firstReactRender20114462231
initialActions107124
loadScripts1021818136810210741184
setupStore1475771629
numNetworkReqs393181153776
Power User HomeuiStartup55222076175172577646610228
load13101151213715113311606
domContentLoaded12941140207614213071572
domInteractive38201843033113
firstPaint2259047287293352
backgroundConnect198429614263219425685896
firstReactRender26175362936
initialActions105112
loadScripts1067906178613310841351
setupStore1764881932
numNetworkReqs1417729145154254
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2202192211221221
srpButtonToSrpForm94939619596
confirmSrpToPwForm22222202222
pwFormToMetricsScreen15151501515
metricsToWalletReadyScreen15151601616
doneButtonToHomeScreen581415720109594720
openAccountMenuToAccountListLoaded28342497310620629343106
total3877384838962038943896
Onboarding New WalletcreateWalletToSocialScreen2182172191218219
srpButtonToPwForm1081071101109110
createPwToRecoveryScreen888088
skipBackupToMetricsScreen38383913939
agreeButtonToOnboardingSuccess17161711717
doneButtonToAssetList49947552019515520
total89186591621906916
Asset DetailsassetClickToPriceChart665278107778
total665278107778
Solana Asset DetailsassetClickToPriceChart1088512816122128
total1088512816122128
Import Srp HomeloginToHomeScreen2302218023877823832387
openAccountMenuAfterLogin77541021995102
homeAfterImportWithNewWallet2327227223934423562393
total4706464047775747584777
Send TransactionsopenSendPageFromHome502290245890
selectTokenToSendFormLoaded31243653636
reviewTransactionToConfirmationPage1249869152623413841526
total1329995158021014451580
SwapopenSwapPageFromHome1298317832149178
fetchAndDisplaySwapQuotes268826822695526882695
total2823279728732928362873
🌐 Dapp Page Load Benchmarks

Current Commit: 6242c6e | Date: 3/18/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 972ms (±106ms) 🟢 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 686ms (±126ms) 🟢 | historical mean value: 729ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 93ms (±190ms) 🟢 | historical mean value: 83ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 972ms 106ms 939ms 2.00s 990ms 2.00s
domContentLoaded 686ms 126ms 657ms 1.92s 700ms 1.92s
firstPaint 93ms 190ms 60ms 1.98s 84ms 1.98s
firstContentfulPaint 93ms 190ms 60ms 1.98s 84ms 1.98s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 20 Bytes (0%)

@gauthierpetetin gauthierpetetin marked this pull request as ready for review March 18, 2026 17:27
@github-project-automation github-project-automation Bot moved this to Needs dev review in PR review queue Mar 18, 2026
Comment thread app/scripts/lib/setupSentry.js Outdated
Comment thread app/scripts/lib/setupSentry.js Outdated

return await fetch(...args);
});
forEachEnvelopeItem(envelope, (item, type) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the purpose of this refactor? The PR description implies that we'd be checking the opt-in status less often, but I don't think that's true. We're still checking once-per-event here, except now we're using a custom transport rather than an integration. it seems like a more confusing way of doing the same thing.

@gauthierpetetin gauthierpetetin Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this PR we were checking the opt-in status twice per event: once in the filterEvents function and once in the makeTransport function.

This PR was about to introduce a third location where the opt-in status was needed: in beforeSend's rewriteReport function, in order to set userId in each event.

So what was a little problematic (twice per event) was about to get more problematic (3 times / event), which is why we've introduced the refactoring that merges the logic that lived in filterEvents, beforeSend, and makeTransport into a single place (the custom makeTransport).

@gauthierpetetin gauthierpetetin Mar 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could check the opt-in status even less by introducing caching mechanism, but what makes me feel uncomfortable with this idea is that we’d technically be able to send an event shortly after opt-in status’s been set to false, when the cached value is still true.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makeTransport is not called per-event, it's called only once when Sentry is initialized. So it was only checking once per event before now.

I am not fully understanding the context of this future second event in rewriteReport. If the user had opted out, I am pretty sure rewriteReport would never get called, so we should have no reason to ever check there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makeTransport is not called per-event, it's called only once when Sentry is initialized. So it was only checking once per event before now.

My bad, you're right, makeTransport is called only once when Sentry is initialized.

If the user had opted out, I am pretty sure rewriteReport would never get called, so we should have no reason to ever check there.

Yes, that's right. But if the user had opted in, rewriteReport would get called, and would fetch the state again to get metaMetricsId and set it here.

So to recap, here's what we'd have without the refactoring:

  1. filterEvents -> 1 state fetch per event to get participateInMetaMetrics
  2. rewriteReport -> 1 state fetch per event to get metaMetricsId
  3. makeTransport -> 1 state fetch at init (not per event) to get participateInMetaMetrics

Here's what we'd have with the refactoring:

  1. makeTransport -> 1 state fetch per event to get both participateInMetaMetrics and metaMetricsId

The refactoring reduces the number of state fetches per event from 2 to 1, which makes me think it's worth it. However, if we think having a custom transport rather than an integration is more confusing, I'm fine to revert.

Please let me know what you think.

cc @davidmurdoch as well in case you have an opinion on this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could derive the id from the debug snapshot

The id set in rewriteReport function is obtained thanks to getMetaMetricsStateFromAppState and getState, which itself gets it from :

globalThis.stateHooks?.getSentryState?.()

That means it is not fetched from local storage or backup storage.
I just wanted to confirm if this is what you mean by "debug snapshot"?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes exactly, that is what I meant by "debug snapshot". That looks good to me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the current implementation does not show an ID for pre-initialization errors.

If we really want id for pre-init errors, I think we can get it from the filter integration without adding a new call to get state (maybe we'd want to rename the integration to reflect the change in purpose, since it would be filtering and tagging with ID).

This is a potential enhancement but I don't think it should be a blocker, the current implementation is a huge step forward already.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it out in this secondary PR: #41191
I replaced filterEvents by a "metaMetricsIntegration", which both checks the opt-in status and injects the metaMetricsId .

If the approach makes sense to you, I'll merge it in order to go straight to the target solution that covers all kind of errors, including pre-initialization errors.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks great!

…d/flush

- Add describe 'makeTransport (construction)' with two unit tests
- Assert fetch is not called when makeTransport() is invoked
- Assert default transport send and flush are not called at construction
- Proves Sentry.makeFetchTransport() does not perform network requests

Made-with: Cursor

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread app/scripts/lib/setupSentry.js Outdated
itsyoboieltr
itsyoboieltr previously approved these changes Mar 26, 2026
…than rewriteReport (#41191)

## **Description**

This PR improves
#40491 by setting
Sentry user id in dedicated metametrics integration, rather than
rewriteReport.

The benefit of this change, is that it would work for pre-initialization
errors as well (cf. @Gudahtt 's comment
[here](#40491 (comment))).

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/41191?quickstart=1)

## **Changelog**

CHANGELOG entry: null

## **Related issues**

See: #40491

## **Manual testing steps**

See: #40491

## **Screenshots/Recordings**

See: #40491

## **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]
> **Medium Risk**
> Changes Sentry event filtering and user identification by moving
MetaMetrics opt-in checks and `user.id` attachment into a new
integration, which could affect which events are sent and how they’re
attributed (including early-init errors).
> 
> **Overview**
> **Moves MetaMetrics-aware Sentry behavior out of `rewriteReport` and
into a dedicated integration.** The new `metaMetricsIntegration` drops
events when MetaMetrics is disabled and, when opted-in, attaches
`event.user.id` from the same async MetaMetrics state resolution used
for gating.
> 
> Removes the old `filterEvents` integration and stops `rewriteReport`
from setting `report.user`, updating tests accordingly (new
`sentry-metametrics` unit tests; removed `setupSentry` user-id
assertions).
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
265ecad. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@metamaskbotv2

metamaskbotv2 Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor
Builds ready [89e3858]
⚡ Performance Benchmarks
👆 Interaction Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Load New Accountload_new_account31827135535348355
total31827135535348355
Confirm Txconfirm_tx6121608561482361306148
total6121608561482361306148
Bridge User Actionsbridge_load_page27418933855322338
bridge_load_asset_picker26020931336287313
bridge_search_token80075488149831881
total1316125513523813421352
🔌 Startup Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Chrome Browserify Startup Standard HomeuiStartup16521393201712717251868
load13541102171513014341565
domContentLoaded13451097170612914261558
domInteractive36201342631105
firstPaint211841392185266314
backgroundConnect22920428315238254
firstReactRender23157882433
initialActions105123
loadScripts1133895147612312261335
setupStore1573561827
numNetworkReqs403186154076
Chrome Browserify Startup Power User HomeuiStartup50982355161192649566910077
load13221135175214313701670
domContentLoaded13021130173913413531584
domInteractive40202173535117
firstPaint252891193164304413
backgroundConnect198131412615232227146909
firstReactRender27194873044
initialActions105113
loadScripts1091935144412211311366
setupStore1664871826
numNetworkReqs1508126439162239
🧭 User Journey Benchmarks
BenchmarkMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P75 (ms)P95 (ms)
Onboarding Import WalletimportWalletToSocialScreen2182172191219219
srpButtonToSrpForm93929629596
confirmSrpToPwForm22212202222
pwFormToMetricsScreen15151601516
metricsToWalletReadyScreen15151601616
doneButtonToHomeScreen57854962931577629
openAccountMenuToAccountListLoaded292429212927229272927
total39343833411511140124115
Onboarding New WalletcreateWalletToSocialScreen2202182211221221
srpButtonToPwForm1141091256113125
createPwToRecoveryScreen889089
skipBackupToMetricsScreen39374114041
agreeButtonToOnboardingSuccess16151811718
doneButtonToAssetList51149852813519528
total9058959117911911
Asset DetailsassetClickToPriceChart665391147091
total665391147091
Solana Asset DetailsassetClickToPriceChart54396595765
total54396595765
Import Srp HomeloginToHomeScreen2542250725672525632567
openAccountMenuAfterLogin623785166985
homeAfterImportWithNewWallet44033654484500544
total30732903321412131963214
Send TransactionsopenSendPageFromHome30303103131
selectTokenToSendFormLoaded33244163541
reviewTransactionToConfirmationPage1011855135519010811355
total9849201136889451136
SwapopenSwapPageFromHome956813523105135
fetchAndDisplaySwapQuotes268926872691226902691
total2787275828262427932826
🌐 Dapp Page Load Benchmarks

Current Commit: 89e3858 | Date: 3/27/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±36ms) 🟡 | historical mean value: 1.03s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 722ms (±34ms) 🟢 | historical mean value: 728ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 85ms (±11ms) 🟢 | historical mean value: 85ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 36ms 1.00s 1.30s 1.06s 1.30s
domContentLoaded 722ms 34ms 699ms 969ms 747ms 969ms
firstPaint 85ms 11ms 64ms 168ms 96ms 168ms
firstContentfulPaint 85ms 11ms 64ms 168ms 96ms 168ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 20 Bytes (0%)

@Gudahtt Gudahtt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-project-automation github-project-automation Bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Apr 1, 2026
@gauthierpetetin gauthierpetetin added this pull request to the merge queue Apr 2, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Apr 2, 2026

Copy link
Copy Markdown

@gauthierpetetin gauthierpetetin added this pull request to the merge queue Apr 2, 2026
@metamaskbotv2

metamaskbotv2 Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor
Builds ready [8ac6e1e]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 1 warn · 🔴 0 fail)

Baseline (latest main): 3dd27e2 | Date: 3/16/58221 | Pipeline: 23889173809 | Baseline logs

Interaction Benchmarks
Benchmarkchrome-browserify
loadNewAccount🟢 [Show logs]
confirmTx🟢 [Show logs]
bridgeUserActions🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: -10%
  • loadNewAccount/total: -10%
  • bridgeUserActions/bridge_search_token: +21%
  • bridgeUserActions/total: +15%
Startup Benchmarks
Benchmarkchrome-browserifychrome-webpackfirefox-browserifyfirefox-webpack
startupStandardHome🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]🟢 [Show logs]
startupPowerUserHome🟢 [Show logs]🟢 [Show logs]
🟡 loadScripts
[Show logs]
🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/initialActions: -38%
  • startupPowerUserHome/backgroundConnect: -24%
  • startupStandardHome/firstPaint: +13%
  • startupPowerUserHome/uiStartup: +12%
  • startupPowerUserHome/firstPaint: +16%
  • startupPowerUserHome/firstReactRender: +15%
  • startupPowerUserHome/setupStore: +13%
  • startupPowerUserHome/numNetworkReqs: +15%
  • startupStandardHome/backgroundConnect: +13%
  • startupStandardHome/initialActions: +43%
  • startupStandardHome/setupStore: +11%
  • startupPowerUserHome/domInteractive: -15%
  • startupPowerUserHome/firstReactRender: -13%
  • startupStandardHome/initialActions: -38%
  • startupStandardHome/setupStore: +21%
  • startupPowerUserHome/setupStore: -23%
User Journey Benchmarks
Benchmarkchrome-browserify
onboardingImportWallet🟢 [Show logs]
onboardingNewWallet🟢 [Show logs]
assetDetails🟢 [Show logs]
solanaAssetDetails🟢 [Show logs]
importSrpHome🟢 [Show logs]
sendTransactions🟢 [Show logs]
swap🟢 [Show logs]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/doneButtonToHomeScreen: -77%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +43%
  • onboardingImportWallet/total: -35%
  • onboardingNewWallet/skipBackupToMetricsScreen: -26%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: -24%
  • onboardingNewWallet/doneButtonToAssetList: -38%
  • onboardingNewWallet/total: -32%
  • assetDetails/assetClickToPriceChart: -68%
  • assetDetails/total: -68%
  • solanaAssetDetails/assetClickToPriceChart: -54%
  • solanaAssetDetails/total: -54%
  • importSrpHome/loginToHomeScreen: +15%
  • importSrpHome/openAccountMenuAfterLogin: -66%
  • importSrpHome/homeAfterImportWithNewWallet: -35%
  • importSrpHome/total: -28%
  • swap/openSwapPageFromHome: -85%
  • swap/fetchAndDisplaySwapQuotes: +26%
🌐 Dapp Page Load Benchmarks

Current Commit: 8ac6e1e | Date: 4/2/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 993ms (±68ms) 🟢 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 702ms (±74ms) 🟢 | historical mean value: 730ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 93ms (±118ms) 🟢 | historical mean value: 85ms ⬆️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 993ms 68ms 952ms 1.37s 1.20s 1.37s
domContentLoaded 702ms 74ms 666ms 1.20s 905ms 1.20s
firstPaint 93ms 118ms 64ms 1.26s 92ms 1.26s
firstContentfulPaint 93ms 118ms 64ms 1.26s 92ms 1.26s
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs
  • background: 58 Bytes (0%)
  • ui: 5 Bytes (0%)
  • common: 20 Bytes (0%)

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 2, 2026
@gauthierpetetin gauthierpetetin added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit f47ee32 Apr 2, 2026
204 of 207 checks passed
@gauthierpetetin gauthierpetetin deleted the feat/sentry-metametrics-user-id-3 branch April 2, 2026 09:05
@github-project-automation github-project-automation Bot moved this from Review finalised - Ready to be merged to Merged, Closed or Archived in PR review queue Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.26.0 Issue or pull request that will be included in release 13.26.0 size-XL team-extension-platform Extension Platform team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants