Skip to content

Commit 12cbb82

Browse files
committed
added sentry for logs and error tracking
1 parent 68f32e7 commit 12cbb82

File tree

36 files changed

+1590
-896
lines changed

36 files changed

+1590
-896
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ yarn-error.log*
4444
*.tsbuildinfo
4545
next-env.d.ts
4646

47+
48+
# Sentry Config File
49+
.env.sentry-build-plugin

bun.lock

Lines changed: 406 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

next.config.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {withSentryConfig} from '@sentry/nextjs';
12
import type { NextConfig } from "next";
23

34
const nextConfig: NextConfig = {
@@ -39,4 +40,35 @@ const nextConfig: NextConfig = {
3940
skipTrailingSlashRedirect: true,
4041
};
4142

42-
export default nextConfig;
43+
export default withSentryConfig(nextConfig, {
44+
// For all available options, see:
45+
// https://www.npmjs.com/package/@sentry/webpack-plugin#options
46+
47+
org: "codepnk",
48+
49+
project: "brand-scope",
50+
51+
// Only print logs for uploading source maps in CI
52+
silent: !process.env.CI,
53+
54+
// For all available options, see:
55+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
56+
57+
// Upload a larger set of source maps for prettier stack traces (increases build time)
58+
widenClientFileUpload: true,
59+
60+
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
61+
// This can increase your server load as well as your hosting bill.
62+
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
63+
// side errors will fail.
64+
tunnelRoute: "/monitoring",
65+
66+
// Automatically tree-shake Sentry logger statements to reduce bundle size
67+
disableLogger: true,
68+
69+
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
70+
// See the following for more information:
71+
// https://docs.sentry.io/product/crons/
72+
// https://vercel.com/docs/cron-jobs
73+
automaticVercelMonitors: true,
74+
});

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@radix-ui/react-toast": "^1.2.6",
3636
"@radix-ui/react-tooltip": "^1.1.8",
3737
"@react-spring/web": "^9.7.5",
38+
"@sentry/nextjs": "^10",
3839
"@stripe/stripe-js": "^7.3.0",
3940
"@supabase/auth-helpers-nextjs": "^0.10.0",
4041
"@supabase/auth-ui-react": "^0.4.7",

sentry.edge.config.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// This file configures the initialization of Sentry for edge features (middleware, edge routes, and so on).
2+
// The config you add here will be used whenever one of the edge features is loaded.
3+
// Note that this config is unrelated to the Vercel Edge Runtime and is also required when running locally.
4+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
5+
6+
import * as Sentry from "@sentry/nextjs";
7+
8+
Sentry.init({
9+
dsn: "https://61e11c0fb3efd04d639e971bd53177e8@o4509925925453824.ingest.us.sentry.io/4509925933383680",
10+
integrations: [
11+
// send console.log, console.warn, and console.error calls as logs to Sentry
12+
Sentry.consoleLoggingIntegration({ levels: ["log", "warn", "error"] }),
13+
],
14+
15+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
16+
tracesSampleRate: 1,
17+
18+
// Enable logs to be sent to Sentry
19+
enableLogs: true,
20+
21+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
22+
debug: false,
23+
});

sentry.server.config.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This file configures the initialization of Sentry on the server.
2+
// The config you add here will be used whenever the server handles a request.
3+
// https://docs.sentry.io/platforms/javascript/guides/nextjs/
4+
5+
import * as Sentry from "@sentry/nextjs";
6+
7+
Sentry.init({
8+
dsn: "https://61e11c0fb3efd04d639e971bd53177e8@o4509925925453824.ingest.us.sentry.io/4509925933383680",
9+
integrations: [
10+
// send console.log, console.warn, and console.error calls as logs to Sentry
11+
Sentry.consoleLoggingIntegration({ levels: ["log", "warn", "error"] }),
12+
],
13+
14+
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control.
15+
tracesSampleRate: 1,
16+
17+
// Enable logs to be sent to Sentry
18+
enableLogs: true,
19+
20+
// Setting this option to true will print useful information to the console while you're setting up Sentry.
21+
debug: false,
22+
});

src/app/api/companymap/route.ts

Lines changed: 0 additions & 71 deletions
This file was deleted.

src/app/api/companysummary/route.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/app/api/fetchcrunchbase/route.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/app/api/fetchfinancialreport/route.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)