From 9a518568963e6bfcae704c55e39ff6c97cdb9127 Mon Sep 17 00:00:00 2001 From: Vectry Date: Wed, 11 Feb 2026 01:35:05 +0000 Subject: [PATCH] feat: add GlitchTip error monitoring integration Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-Claude) Co-authored-by: Sisyphus --- apps/web/next.config.mjs | 8 +++++++- apps/web/package.json | 1 + apps/web/sentry.client.config.ts | 7 +++++++ apps/web/sentry.edge.config.ts | 7 +++++++ apps/web/sentry.server.config.ts | 7 +++++++ apps/web/src/instrumentation.ts | 13 +++++++++++++ docker-compose.yml | 2 ++ 7 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 apps/web/sentry.client.config.ts create mode 100644 apps/web/sentry.edge.config.ts create mode 100644 apps/web/sentry.server.config.ts create mode 100644 apps/web/src/instrumentation.ts diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 3cc3f6d..0f0a4d0 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,7 +1,13 @@ +import { withSentryConfig } from "@sentry/nextjs"; + /** @type {import('next').NextConfig} */ const config = { transpilePackages: ["@codeboard/shared", "@codeboard/database"], output: "standalone", }; -export default config; +export default withSentryConfig(config, { + silent: !process.env.CI, + disableServerWebpackPlugin: true, + disableClientWebpackPlugin: true, +}); diff --git a/apps/web/package.json b/apps/web/package.json index 6ebbb66..64f6e1a 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -29,6 +29,7 @@ "react-markdown": "^9.0.0", "stripe": "^20.3.1", "tailwind-merge": "^2.6.0", + "@sentry/nextjs": "^8.28.0", "zod": "^3.24.0" }, "devDependencies": { diff --git a/apps/web/sentry.client.config.ts b/apps/web/sentry.client.config.ts new file mode 100644 index 0000000..cd110f7 --- /dev/null +++ b/apps/web/sentry.client.config.ts @@ -0,0 +1,7 @@ +import * as Sentry from "@sentry/nextjs"; + +Sentry.init({ + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1, + debug: false, +}); diff --git a/apps/web/sentry.edge.config.ts b/apps/web/sentry.edge.config.ts new file mode 100644 index 0000000..cd110f7 --- /dev/null +++ b/apps/web/sentry.edge.config.ts @@ -0,0 +1,7 @@ +import * as Sentry from "@sentry/nextjs"; + +Sentry.init({ + dsn: process.env.NEXT_PUBLIC_SENTRY_DSN, + tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1, + debug: false, +}); diff --git a/apps/web/sentry.server.config.ts b/apps/web/sentry.server.config.ts new file mode 100644 index 0000000..d9bc92d --- /dev/null +++ b/apps/web/sentry.server.config.ts @@ -0,0 +1,7 @@ +import * as Sentry from "@sentry/nextjs"; + +Sentry.init({ + dsn: process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN, + tracesSampleRate: process.env.NODE_ENV === "development" ? 1.0 : 0.1, + debug: false, +}); diff --git a/apps/web/src/instrumentation.ts b/apps/web/src/instrumentation.ts new file mode 100644 index 0000000..ecb6528 --- /dev/null +++ b/apps/web/src/instrumentation.ts @@ -0,0 +1,13 @@ +import * as Sentry from "@sentry/nextjs"; + +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"); + } +} + +export const onRequestError = Sentry.captureRequestError; diff --git a/docker-compose.yml b/docker-compose.yml index 345dbe4..e686059 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,6 +21,8 @@ services: - EMAIL_USER=hunter@repi.fun - EMAIL_PASSWORD=${EMAIL_PASSWORD:-} - NEXT_PUBLIC_APP_URL=https://codeboard.vectry.tech + - NEXT_PUBLIC_SENTRY_DSN=https://637c487708794aaf8f2399496cd2e6c6@glitchtip.vectry.tech/2 + - SENTRY_DSN=https://637c487708794aaf8f2399496cd2e6c6@glitchtip.vectry.tech/2 depends_on: redis: condition: service_started