Adding Sentry Code Observability

This commit is contained in:
Richard Propst 2021-09-29 09:54:33 -07:00
parent f9644fecef
commit 8e1fbcf0bd
8 changed files with 32259 additions and 5419 deletions

24
_next.config.js Normal file
View File

@ -0,0 +1,24 @@
// This file sets a custom webpack configuration to use your Next.js app
// with Sentry.
// https://nextjs.org/docs/api-reference/next.config.js/introduction
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
const { withSentryConfig } = require('@sentry/nextjs');
const moduleExports = {
// Your existing module.exports
};
const SentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
};
// Make sure adding Sentry options is the last code to run before exporting, to
// ensure that your source maps include changes from all other Webpack plugins
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions);

View File

@ -11,7 +11,23 @@ const isSaleor = provider === 'saleor'
const isSwell = provider === 'swell'
const isVendure = provider === 'vendure'
module.exports = withCommerceConfig({
// This file sets a custom webpack configuration to use your Next.js app
// with Sentry.
// https://nextjs.org/docs/api-reference/next.config.js/introduction
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
const { withSentryConfig } = require('@sentry/nextjs');
const SentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
};
let moduleExports = withCommerceConfig({
commerce,
i18n: {
locales: ['en-US', 'es'],
@ -40,5 +56,9 @@ module.exports = withCommerceConfig({
},
})
// Make sure adding Sentry options is the last code to run before exporting, to
// ensure that your source maps include changes from all other Webpack plugins
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions);
// Don't delete this console log, useful to see the commerce config in Vercel deployments
console.log('next.config.js', JSON.stringify(module.exports, null, 2))

26130
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,8 @@
},
"dependencies": {
"@react-spring/web": "^9.2.1",
"@sentry/nextjs": "^6.13.2",
"@sentry/wizard": "^1.2.13",
"@vercel/fetch": "^6.1.0",
"autoprefixer": "^10.2.6",
"body-scroll-lock": "^3.1.5",

15
sentry.client.config.js Normal file
View File

@ -0,0 +1,15 @@
// This file configures the initialization of Sentry on the browser.
// The config you add here will be used whenever a page is visited.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from '@sentry/nextjs';
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
Sentry.init({
dsn: SENTRY_DSN || 'https://024f4e00d89a4125a7b42d3cbeadd28c@o1017684.ingest.sentry.io/5985074',
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
tracesSampleRate: 1.0,
});

5
sentry.properties Normal file
View File

@ -0,0 +1,5 @@
defaults.url=https://sentry.io/
defaults.org=vercel-sentry-solutions
defaults.project=commerce-test
auth.token=22604d4f05a1433c83e4805fac8b83b117033ff1623745f082259137943d5a3f
cli.executable=../../../../.nvm/versions/node/v16.10.0/lib/node_modules/@sentry/wizard/node_modules/@sentry/cli/bin/sentry-cli

15
sentry.server.config.js Normal file
View File

@ -0,0 +1,15 @@
// This file configures the initialization of Sentry on the server.
// The config you add here will be used whenever the server handles a request.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from '@sentry/nextjs';
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN;
Sentry.init({
dsn: SENTRY_DSN || 'https://024f4e00d89a4125a7b42d3cbeadd28c@o1017684.ingest.sentry.io/5985074',
// Note: if you want to override the automatic release value, do not set a
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
// that it will also get attached to your source maps
tracesSampleRate: 1.0,
});

11465
yarn.lock

File diff suppressed because it is too large Load Diff