Skip to content

Commit

Permalink
Update Sentry and ooni components (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
majakomel committed Sep 6, 2024
1 parent 7fd05e9 commit 7e037be
Show file tree
Hide file tree
Showing 9 changed files with 1,476 additions and 931 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ yalc.lock

# Sentry Config File
.sentryclirc

# Sentry Config File
.env.sentry-build-plugin
9 changes: 9 additions & 0 deletions instrumentation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
await import('./sentry.server.config');
}

if (process.env.NEXT_RUNTIME === 'edge') {
await import('./sentry.edge.config');
}
}
10 changes: 1 addition & 9 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,27 +126,19 @@ module.exports = withBundleAnalyzer(
silent: true,
org: 'ooni',
project: 'explorer',
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: '/monitoring',

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors.
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@nivo/funnel": "^0.80.0",
"@nivo/line": "^0.80.0",
"@nivo/tooltip": "0.80.0",
"@sentry/nextjs": "^7.109.0",
"@sentry/nextjs": "^8.28.0",
"@tanstack/react-table": "^8.11.6",
"axios": "^1.7.4",
"buffer-from": "^1.1.2",
Expand All @@ -29,7 +29,7 @@
"markdown-to-jsx": "^7.4.0",
"next": "^14.2.4",
"nprogress": "^0.2.0",
"ooni-components": "0.7.0-alpha.10",
"ooni-components": "0.7.0-alpha.11",
"pretty-ms": "^8.0.0",
"prop-types": "^15.8.1",
"react": "^18.3.1",
Expand All @@ -48,7 +48,7 @@
"react-window": "^1.8.10",
"regenerator-runtime": "^0.14.1",
"swr": "^2.2.5",
"tailwind-merge": "^2.3.0",
"tailwind-merge": "^2.5.2",
"use-clipboard-copy": "^0.2.0",
"victory": "32.0.2",
"yup": "^1.3.3"
Expand Down
2 changes: 1 addition & 1 deletion public/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* - Please do NOT serve this file on production.
*/

const PACKAGE_VERSION = '2.3.1'
const PACKAGE_VERSION = '2.4.2'
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()
Expand Down
14 changes: 1 addition & 13 deletions sentry.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,8 @@ Sentry.init({
/^ResizeObserver loop completed with undelivered notifications.$/,
'__gCrWeb',
],
// Adjust this value in production, or use tracesSampler for greater control
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
replaysOnErrorSampleRate: 1.0,
// This sets the sample rate to be 10%. You may want this to be 100% while
// in development and sample at a lower rate in production
replaysSessionSampleRate: 0.1,
// You can remove this option if you're not planning to use the Sentry Session Replay feature:
// integrations: [
// Sentry.replayIntegration({
// // Additional Replay configuration goes in here, for example:
// maskAllText: true,
// blockAllMedia: true,
// }),
// ],
})
2 changes: 1 addition & 1 deletion sentry.edge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN

Sentry.init({
dsn: SENTRY_DSN,
// Adjust this value in production, or use tracesSampler for greater control
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
Expand Down
2 changes: 1 addition & 1 deletion sentry.server.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN

Sentry.init({
dsn: SENTRY_DSN,
// Adjust this value in production, or use tracesSampler for greater control
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
tracesSampleRate: 1,
// Setting this option to true will print useful information to the console while you're setting up Sentry.
debug: false,
Expand Down
Loading

0 comments on commit 7e037be

Please sign in to comment.