telemetry toggle

This commit is contained in:
Crazypersonalph
2023-12-07 12:21:59 +08:00
parent 0110475dc2
commit 03ab5f0cdc
11 changed files with 77 additions and 63 deletions
+19 -21
View File
@@ -1,27 +1,25 @@
/* eslint-disable no-inner-declarations */
import * as Sentry from "@sentry/browser";
Sentry.init({
dsn: "https://54bdb68e80b45182ded22ecf9fe9529c@o4506347383291904.ingest.sentry.io/4506347462393856",
// Alternatively, use `process.env.npm_package_version` for a dynamic release version
// if your build tool supports it.
release: "betterseqtaplus@3.2.2",
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],
// 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:\/\/yourserver\.io\/api/],
// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
});
browser.storage.local.get([ "telemetry" ]).then((telemetry) => {
if (telemetry.telemetry === true) {
Sentry.init({
dsn: "https://54bdb68e80b45182ded22ecf9fe9529c@o4506347383291904.ingest.sentry.io/4506347462393856",
integrations: [
new Sentry.BrowserTracing({
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
}),
new Sentry.Replay(),
],
// Performance Monitoring
tracesSampleRate: 1.0, // Capture 100% of the transactions
// Session Replay
replaysSessionSampleRate: 0.1, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
replaysOnErrorSampleRate: 1.0, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
});
}
})
import browser from 'webextension-polyfill';
import { animate, spring, stagger } from 'motion';
import Color from 'color';