-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Errors are reported using `captureException`, and non-errors are added as breadcrumbs. This means the non-error events won't be directly sent to Sentry, but they will be included as context for any errors that do occur. The sentry configuration is mainly in the `sentry.debug.properties` file. The only config outside of that file is the DSN used for reporting errors, which is hard-coded in the `setupSentry.js` module. There are three separate sets of config: default, debug, and release. The default config is missing the auth token, so it can't be used to publish source maps. However, builds that use the default config will still correctly report errors to the `test-metamask-mobile` Sentry project. The debug config is identical to the default config except that it includes the auth token. The debug config is for publishing any non-production builds (e.g. testing, pre-releases). The release configuration is to be used for production builds only. This is the only config that sends errors to the `metemask-mobile` Sentry project. The debug and release config files have not been added to the repo. They are automatically instantiated from the example files if the `MM_SENTRY_AUTH_TOKEN` environment variable is set. Setting this environment variable in CI should allow publishing from CI. Closes #1321
- Loading branch information
Showing
14 changed files
with
415 additions
and
40 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,5 +63,9 @@ coverage | |
.ios.env | ||
.android.env | ||
|
||
# Sentry | ||
/sentry.debug.properties | ||
/sentry.release.properties | ||
|
||
# editor | ||
.vscode |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { init } from '@sentry/react-native'; | ||
import { Dedupe, ExtraErrorData } from '@sentry/integrations'; | ||
|
||
const METAMASK_ENVIRONMENT = process.env['METAMASK_ENVIRONMENT']; // eslint-disable-line dot-notation | ||
const SENTRY_DSN_PROD = 'https://[email protected]/2299799'; // metamask-mobile | ||
const SENTRY_DSN_DEV = 'https://[email protected]/2651591'; // test-metamask-mobile | ||
|
||
// Setup sentry remote error reporting | ||
export default function setupSentry() { | ||
const environment = __DEV__ || !METAMASK_ENVIRONMENT ? 'development' : METAMASK_ENVIRONMENT; | ||
const dsn = environment === 'production' ? SENTRY_DSN_PROD : SENTRY_DSN_DEV; | ||
init({ | ||
dsn, | ||
debug: __DEV__, | ||
environment, | ||
integrations: [new Dedupe(), new ExtraErrorData()] | ||
}); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
defaults.url=https://sentry.io/ | ||
defaults.org=metamask | ||
defaults.project=test-metamask-mobile | ||
auth.token= | ||
cli.executable=node_modules/@sentry/cli/bin/sentry-cli |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
defaults.url=https://sentry.io/ | ||
defaults.org=metamask | ||
defaults.project=test-metamask-mobile | ||
auth.token= | ||
cli.executable=node_modules/@sentry/cli/bin/sentry-cli |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
defaults.url=https://sentry.io/ | ||
defaults.org=metamask | ||
defaults.project=metamask-mobile | ||
auth.token= | ||
cli.executable=node_modules/@sentry/cli/bin/sentry-cli |
Oops, something went wrong.