Add Sentry (:
All checks were successful
Deploy Frontend / docker (17, 3.8.5) (push) Successful in 2m18s

This commit is contained in:
Braydon 2024-04-27 02:54:59 -04:00
parent 57dc61f745
commit e0c92ca95a
7 changed files with 122 additions and 18 deletions

3
Frontend/.gitignore vendored

@ -4,4 +4,5 @@ node_modules
.VSCodeCounter/
.next/
.env*.local
next-env.d.ts
next-env.d.ts
.sentryclirc

Binary file not shown.

@ -1,26 +1,63 @@
import {withSentryConfig} from "@sentry/nextjs";
import createMDX from '@next/mdx'
/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
images: {
remotePatterns: [
{
protocol: "https",
hostname: "api.restfulmc.cc",
},
{
protocol: "https",
hostname: "flagcdn.com",
},
],
},
experimental: {
mdxRs: true,
},
pageExtensions: ["ts", "tsx", "js", "jsx", "md", "mdx"],
images: {
remotePatterns: [
{
protocol: "https",
hostname: "api.restfulmc.cc",
},
{
protocol: "https",
hostname: "flagcdn.com",
},
],
},
experimental: {
mdxRs: true,
},
};
const withMDX = createMDX({})
// Merge MDX config with Next.js config
export default withMDX(nextConfig)
export default withSentryConfig(withMDX(nextConfig), {
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
// Suppresses source map uploading logs during build
silent: true,
org: "restfulmc",
project: "frontend",
url: "https://sentry.rainnny.club/"
}, {
// 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,
// Uncomment to route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
// This can increase your server load as well as your hosting bill.
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
// 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.
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
});

@ -33,6 +33,7 @@
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-toast": "^1.1.5",
"@radix-ui/react-tooltip": "^1.0.7",
"@sentry/nextjs": "7.105.0",
"@types/mdx": "^2.0.13",
"@types/react-syntax-highlighter": "^15.5.11",
"class-variance-authority": "^0.7.0",

@ -0,0 +1,30 @@
// This file configures the initialization of Sentry on the client.
// The config you add here will be used whenever a users loads a page in their browser.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: "https://0525d8dacaae432aaf967d2dd303dc35@sentry.rainnny.club/1",
// 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,
}),
],
});

@ -0,0 +1,16 @@
// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
// The config you add here will be used whenever one of the edge features is loaded.
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
import * as Sentry from "@sentry/nextjs";
Sentry.init({
dsn: "https://0525d8dacaae432aaf967d2dd303dc35@sentry.rainnny.club/1",
// 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,
});

@ -0,0 +1,19 @@
// 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";
Sentry.init({
dsn: "https://0525d8dacaae432aaf967d2dd303dc35@sentry.rainnny.club/1",
// 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,
// uncomment the line below to enable Spotlight (https://spotlightjs.com)
// spotlight: process.env.NODE_ENV === 'development',
});