-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5c0a83
commit 1379b4a
Showing
4 changed files
with
95 additions
and
81 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
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 |
---|---|---|
|
@@ -177,36 +177,41 @@ export const makeMegaStoreContext = () => { | |
const reportDiagnostics = | ||
localStorage.getItem("report_diagnostics") === "true"; | ||
|
||
if (reportDiagnostics && sentryenv !== "") { | ||
Sentry.init({ | ||
dsn: "https://[email protected]/2", | ||
environment: sentryenv, | ||
release: "mutiny-web@" + RELEASE_VERSION, | ||
integrations: [ | ||
Sentry.browserTracingIntegration(), | ||
Sentry.replayIntegration() | ||
], | ||
|
||
initialScope: { | ||
tags: { component: "main" } | ||
}, | ||
|
||
// Set tracesSampleRate to 1.0 to capture 100% | ||
// of transactions for performance monitoring. | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: 1.0, | ||
|
||
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled | ||
tracePropagationTargets: [ | ||
"localhost", | ||
/^https:\/\/mutinywallet\.com/ | ||
], | ||
|
||
// Capture Replay for 10% of all sessions, | ||
// plus 100% of sessions with an error | ||
replaysSessionSampleRate: 0.1, | ||
replaysOnErrorSampleRate: 1.0 | ||
}); | ||
try { | ||
// If there's a password that means we've already setup sentry the first time | ||
if (reportDiagnostics && sentryenv !== "" && !password) { | ||
Sentry.init({ | ||
dsn: "https://[email protected]/2", | ||
environment: sentryenv, | ||
release: "mutiny-web@" + RELEASE_VERSION, | ||
integrations: [ | ||
Sentry.browserTracingIntegration(), | ||
Sentry.replayIntegration() | ||
], | ||
|
||
initialScope: { | ||
tags: { component: "main" } | ||
}, | ||
|
||
// Set tracesSampleRate to 1.0 to capture 100% | ||
// of transactions for performance monitoring. | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: 1.0, | ||
|
||
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled | ||
tracePropagationTargets: [ | ||
"localhost", | ||
/^https:\/\/mutinywallet\.com/ | ||
], | ||
|
||
// Capture Replay for 10% of all sessions, | ||
// plus 100% of sessions with an error | ||
replaysSessionSampleRate: 0.1, | ||
replaysOnErrorSampleRate: 1.0 | ||
}); | ||
} | ||
} catch (e) { | ||
console.error("Error initializing sentry", e); | ||
} | ||
|
||
// handle lsp settings | ||
|
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 |
---|---|---|
|
@@ -102,52 +102,63 @@ export async function setupMutinyWallet( | |
nsec?: string | ||
): Promise<boolean> { | ||
// initialize both inside worker and outside | ||
if (reportDiagnostics && sentryenv !== "") { | ||
Sentry.init({ | ||
dsn: "https://[email protected]/2", | ||
environment: sentryenv, | ||
release: "mutiny-web@" + RELEASE_VERSION, | ||
integrations: [ | ||
Sentry.captureConsoleIntegration(), // grab all mutiny-node console lines | ||
Sentry.browserTracingIntegration(), | ||
Sentry.replayIntegration() | ||
], | ||
|
||
initialScope: { | ||
tags: { component: "worker" } | ||
}, | ||
|
||
// ignore any hex larger than 20 char | ||
ignoreErrors: [/(?:[0-9a-fA-F]{20,}\b)+/], | ||
|
||
// only do a new issue for errors w/ or w/o exceptions, and warnings | ||
beforeSend(event, hint) { | ||
const error = hint.originalException; | ||
if (error && typeof error === "object" && "message" in error) { | ||
return event; | ||
} else if (event.level == "warning" || event.level == "error") { | ||
return event; | ||
} else { | ||
return null; | ||
} | ||
}, | ||
|
||
// Set tracesSampleRate to 1.0 to capture 100% | ||
// of transactions for performance monitoring. | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: 1.0, | ||
|
||
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled | ||
tracePropagationTargets: [ | ||
"localhost", | ||
/^https:\/\/mutinywallet\.com/ | ||
], | ||
|
||
// Capture Replay for 10% of all sessions, | ||
// plus 100% of sessions with an error | ||
replaysSessionSampleRate: 0.1, | ||
replaysOnErrorSampleRate: 1.0 | ||
}); | ||
try { | ||
if (reportDiagnostics && sentryenv !== "") { | ||
Sentry.init({ | ||
dsn: "https://[email protected]/2", | ||
environment: sentryenv, | ||
release: "mutiny-web@" + RELEASE_VERSION, | ||
integrations: [ | ||
Sentry.captureConsoleIntegration(), // grab all mutiny-node console lines | ||
Sentry.browserTracingIntegration(), | ||
Sentry.replayIntegration() | ||
], | ||
|
||
initialScope: { | ||
tags: { component: "worker" } | ||
}, | ||
|
||
// ignore any hex larger than 20 char | ||
ignoreErrors: [/(?:[0-9a-fA-F]{20,}\b)+/], | ||
|
||
// only do a new issue for errors w/ or w/o exceptions, and warnings | ||
beforeSend(event, hint) { | ||
const error = hint.originalException; | ||
if ( | ||
error && | ||
typeof error === "object" && | ||
"message" in error | ||
) { | ||
return event; | ||
} else if ( | ||
event.level == "warning" || | ||
event.level == "error" | ||
) { | ||
return event; | ||
} else { | ||
return null; | ||
} | ||
}, | ||
|
||
// Set tracesSampleRate to 1.0 to capture 100% | ||
// of transactions for performance monitoring. | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: 1.0, | ||
|
||
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled | ||
tracePropagationTargets: [ | ||
"localhost", | ||
/^https:\/\/mutinywallet\.com/ | ||
], | ||
|
||
// Capture Replay for 10% of all sessions, | ||
// plus 100% of sessions with an error | ||
replaysSessionSampleRate: 0.1, | ||
replaysOnErrorSampleRate: 1.0 | ||
}); | ||
} | ||
} catch (e) { | ||
console.error("Error initializing sentry", e); | ||
} | ||
|
||
console.log("Starting setup..."); | ||
|