feat: add transaction performance metrics#26332
Merged
matthewwalsh0 merged 66 commits intodevelopfrom Aug 22, 2024
Merged
Conversation
Simplify Sentry logic. Improve Sentry logging. Fix toggle timings.
Add Sentry buttons in developer options.
Include type in log message.
Add local timings. Move internal messages to separte logger.
Pass span to callback.
Remove package script duplication.
…ance-infrastructure
Fix unit tests.
Collaborator
Builds ready [563731f]
Page Load Metrics (94 ± 26 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
pedronfigueiredo
previously approved these changes
Aug 20, 2024
bfbdb98
Comment on lines
+16
to
+22
| req.traceContext = await trace({ | ||
| name: 'Transaction', | ||
| id, | ||
| tags: { source: 'dapp' }, | ||
| }); | ||
|
|
||
| await trace({ name: 'Middleware', id, parentContext: req.traceContext }); |
Contributor
There was a problem hiding this comment.
should this be in a try/catch?
Member
Author
There was a problem hiding this comment.
I don't believe there is any known error scenarios here, so it shouldn't introduce any more risk than any other middleware for example.
|
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@metamask/transaction-controller@34.0.0 |
|
Collaborator
Builds ready [aff65ce]
Page Load Metrics (166 ± 186 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
HowardBraham
approved these changes
Aug 21, 2024
pedronfigueiredo
approved these changes
Aug 22, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Add initial custom instrumentation around transactions initiated from a dApp.
Specifically:
traceutility function to support no callback argument and only start a trace to be manually ended later.endTraceutility function.endBackgroundTraceaction to contribute to background metrics from the UI.METAMASK_DEBUGis set.tracecallback andtraceContexttoTransactionController.Notification Displaytrace (started from controller) as soon as transaction confirmation is rendered with matching ID.Related issues
Fixes: #2850
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist