Skip to content

chore(sentry): enable performance monitoring#22092

Closed
gauthierpetetin wants to merge 2 commits intofix/sentry-sessionsfrom
feat/sentry-performance-monitoring
Closed

chore(sentry): enable performance monitoring#22092
gauthierpetetin wants to merge 2 commits intofix/sentry-sessionsfrom
feat/sentry-performance-monitoring

Conversation

@gauthierpetetin
Copy link
Copy Markdown
Contributor

@gauthierpetetin gauthierpetetin commented Nov 29, 2023

Description

Setting a value for tracesSampleRate enables performance monitoring in Sentry. Once performance monitoring is enabled, transactions are sent to Sentry every time a user loads a page or navigates within the app. Since the amount of traffic the app gets is important, this means a lot of transactions are sent. By setting tracesSampleRate to a value lower than 1.0, we reduce the volume of transactions to a more reasonable amount.

Sentry documentation
Mobile implementation

Enabling Sentry performance monitoring will allow us to add app load time to our North Star metrics dashboards, like we do for Mobile.
Screenshot 2023-11-29 at 17 12 18

Related issues

  • None

Manual testing steps

  1. Create your own Sentry instance

  2. Go to Sentry Performance dashboard and you shall see no transaction

  3. Select Settings in the sidebar menu, then select Projects in the secondary menu. Click your project then select Client Keys (DSN) from the secondary menu. Click the Configure button on the Client Keys page and copy your Project Id and Public Key.

  4. Add/replace SENTRY_DSN_DEV variable in .metamaskrc

    SENTRY_DSN_DEV=https://{SENTRY_PUBLIC_KEY}@sentry.io/{SENTRY_PROJECT_ID}
    
  5. Build the project to the ./dist/ folder with yarn dist

  6. Add Extension to your browser

  7. Open Extension and do some actions

  8. Kill the Extension

  9. Go to Sentry Performance dashboard and you shall see a few transactions

Screenshots/Recordings

Before

Screenshot 2023-11-29 at 16 31 20

After

Screenshot 2023-11-29 at 17 01 04 Screenshot 2023-11-29 at 17 00 26

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@gauthierpetetin gauthierpetetin requested a review from a team as a code owner November 29, 2023 20:06
@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.

* transactions are sent. By setting `tracesSampleRate` to a value lower than 1.0, we
* reduce the volume of transactions to a more reasonable amount.
*/
tracesSampleRate: 0.1,
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.

Mobile is using a sampling rate of 0.05, and even that small a rate is a huge amount of events. We should consider adjusting this based upon our current account limits, also taking into consideration the userbase between extension and mobile.

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.

Given tracesSampleRate is currently set to 0.04 for Mobile and given that the amount of MAU is more than 3x more important for Extension, I guess we can set tracesSampleRate to 0.01 for Extension.

Copy link
Copy Markdown

@screwball22 screwball22 left a comment

Choose a reason for hiding this comment

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

JSON v5

Setting a value for tracesSampleRate enables performance monitoring in Sentry. Once performance monitoring is enabled, transactions are sent to Sentry every time a user loads a page or navigates within the app. Since the amount of traffic the app gets is important, this means a lot of transactions are sent. By setting tracesSampleRate to a value lower than 1.0, we reduce the volume of transactions to a more reasonable amount.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2024

This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Apr 9, 2024
@github-actions
Copy link
Copy Markdown
Contributor

This PR was closed because there has been no follow up activity in the last 14 days. Thank you for your contributions.

@github-actions github-actions bot closed this Apr 23, 2024
@gauthierpetetin gauthierpetetin removed the stale issues and PRs marked as stale label Apr 23, 2024
@legobeat legobeat changed the title feat(sentry): enable performance monitoring chore(sentry): enable performance monitoring Apr 23, 2024
Given tracesSampleRate is currently set to 0.04 for Mobile and given that the amount of MAU is more than 3x more important for Extension, we can set tracesSampleRate to 0.01 for Extension in order not to exceed our account limits.
@gauthierpetetin gauthierpetetin changed the base branch from fix/sentry-sessions to develop May 31, 2024 18:22
@gauthierpetetin gauthierpetetin changed the base branch from develop to fix/sentry-sessions May 31, 2024 18:23
@gauthierpetetin
Copy link
Copy Markdown
Contributor Author

Replaced by this PR: #24951

@github-actions github-actions bot locked and limited conversation to collaborators May 31, 2024
@HowardBraham HowardBraham deleted the feat/sentry-performance-monitoring branch January 19, 2026 21:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-sentry Issue from Sentry team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants