Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sentry): Adding extensionId and installType to Sentry #26482

Merged
merged 14 commits into from
Aug 21, 2024

Conversation

vthomas13
Copy link
Contributor

@vthomas13 vthomas13 commented Aug 16, 2024

Description

We want to differentiate between errors from our published extension, and errors from side-loaded extensions or forks that we don't support. Adding extensionID to our Sentry logs helps us do that. Following @Gudahtt's suggestion to use https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/management/getSelf to add installType as well.

Open in GitHub Codespaces

Related issues

Fixes: #26444

Manual testing steps

  1. Run app, go to network tab in devtools
  2. Filter for sentry envelope request and verify

Screenshots/Recordings

Before

After

image

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.

Copy link
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.

@vthomas13 vthomas13 changed the title WIP: Adding extensionId to Sentry report feat(sentry): Adding extensionId and installType to Sentry Aug 19, 2024
@vthomas13 vthomas13 marked this pull request as ready for review August 19, 2024 20:50
@vthomas13 vthomas13 requested a review from a team as a code owner August 19, 2024 20:50
@metamaskbot
Copy link
Collaborator

Builds ready [925845a]
Page Load Metrics (102 ± 26 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint794991418842
domContentLoaded47314995627
load543141025526
domInteractive10128382713
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 21 Bytes (0.00%)
  • ui: 8.02 KiB (0.11%)
  • common: -7.22 KiB (-0.09%)

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

Attention: Patch coverage is 56.25000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 70.01%. Comparing base (ab79f0d) to head (3184f9f).

Files Patch % Lines
app/scripts/lib/setupSentry.js 30.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #26482      +/-   ##
===========================================
- Coverage    70.02%   70.01%   -0.01%     
===========================================
  Files         1408     1409       +1     
  Lines        49105    49115      +10     
  Branches     13735    13737       +2     
===========================================
+ Hits         34383    34386       +3     
- Misses       14722    14729       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [1c74bad]
Page Load Metrics (106 ± 31 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint863871346129
domContentLoaded573801026632
load573831066531
domInteractive1799362211
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 21 Bytes (0.00%)
  • ui: 8.02 KiB (0.11%)
  • common: -7.22 KiB (-0.09%)

Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

Generally looks good! No tests though. We could add this to the existing errors e2e tests, maybe as an additional assertion for the "should capture ___ state" tests?

vthomas13 and others added 3 commits August 20, 2024 17:03
@vthomas13
Copy link
Contributor Author

Added tests in 649e677

@vthomas13 vthomas13 requested a review from Gudahtt August 20, 2024 22:27
@metamaskbot
Copy link
Collaborator

Builds ready [844d090]
Page Load Metrics (70 ± 7 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint7112395147
domContentLoaded4710365157
load5410370147
domInteractive126023115
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 21 Bytes (0.00%)
  • ui: 8.02 KiB (0.11%)
  • common: -7.22 KiB (-0.09%)

Gudahtt
Gudahtt previously approved these changes Aug 21, 2024
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

* origin/develop:
  feat: Redesign Approve confirmation (#26464)
  fix: Fix MV2 build sourcemap upload (#26467)
  feat: Enable hardware wallets for smart transactions, sign a transaction only once (#26251)
  fix: Allowlist Snap UI card component (#26565)
  fix(deps): Bump `@metamask/eth-json-rpc-middleware` to `^14.0.0`, `@metamask/transaction-controller` to `^35.1.1` (#26143)
  fix: adding warning for origin on redesigned pages (#26306)
  fix: track `swapAndSend` transaction type (#26535)
@@ -1,12 +1,13 @@
import * as Sentry from '@sentry/browser';
import { createModuleLogger, createProjectLogger } from '@metamask/utils';
import { logger } from '@sentry/utils';
import { AllProperties } from '../../../shared/modules/object.utils';
import browser from 'webextension-polyfill';
import { isManifestV3 } from '../../../shared/modules/mv3.utils';
Copy link
Member

Choose a reason for hiding this comment

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

This was the only line with a conflict in the most recent merge with develop. I just had to preserve this import

@Gudahtt
Copy link
Member

Gudahtt commented Aug 21, 2024

Just merged with develop to resolve a conflict, a very simple one, details here: #26482 (comment)

Copy link

sonarcloud bot commented Aug 21, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [3184f9f]
Page Load Metrics (79 ± 8 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint85154103178
domContentLoaded5012873189
load5612879178
domInteractive17452773
Bundle size diffs [🚀 Bundle size reduced!]
  • background: 21 Bytes (0.00%)
  • ui: 8.17 KiB (0.12%)
  • common: -7.41 KiB (-0.09%)

@Gudahtt Gudahtt merged commit e174704 into develop Aug 21, 2024
78 checks passed
@Gudahtt Gudahtt deleted the extension-id-sentry branch August 21, 2024 15:49
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2024
@metamaskbot metamaskbot added the release-12.5.0 Issue or pull request that will be included in release 12.5.0 label Aug 21, 2024
@gauthierpetetin gauthierpetetin added release-12.4.0 Issue or pull request that will be included in release 12.4.0 and removed release-12.5.0 Issue or pull request that will be included in release 12.5.0 labels Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.4.0 Issue or pull request that will be included in release 12.4.0 team-extension-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Track extension ID in Sentry diagnostic state
5 participants