-
Notifications
You must be signed in to change notification settings - Fork 44.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
1,770 additions
and
5,384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,6 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
# Sentry Config File | ||
.env.sentry-build-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// 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://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288", | ||
|
||
// Add optional integrations for additional features | ||
integrations: [ | ||
Sentry.replayIntegration(), | ||
Sentry.httpClientIntegration(), | ||
Sentry.replayCanvasIntegration(), | ||
Sentry.reportingObserverIntegration(), | ||
Sentry.browserProfilingIntegration(), | ||
// Sentry.feedbackIntegration({ | ||
// // Additional SDK configuration goes in here, for example: | ||
// colorScheme: "system", | ||
// }), | ||
], | ||
|
||
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. | ||
tracesSampleRate: 1, | ||
|
||
// Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled | ||
tracePropagationTargets: [ | ||
"localhost", | ||
/^https:\/\/dev\-builder\.agpt\.co\/api/, | ||
], | ||
|
||
beforeSend(event, hint) { | ||
// Check if it is an exception, and if so, show the report dialog | ||
if (event.exception && event.event_id) { | ||
Sentry.showReportDialog({ eventId: event.event_id }); | ||
} | ||
return event; | ||
}, | ||
|
||
// Define how likely Replay events are sampled. | ||
// 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, | ||
|
||
// Define how likely Replay events are sampled when an error occurs. | ||
replaysOnErrorSampleRate: 1.0, | ||
|
||
// Setting this option to true will print useful information to the console while you're setting up Sentry. | ||
debug: false, | ||
|
||
// Set profilesSampleRate to 1.0 to profile every transaction. | ||
// Since profilesSampleRate is relative to tracesSampleRate, | ||
// the final profiling rate can be computed as tracesSampleRate * profilesSampleRate | ||
// For example, a tracesSampleRate of 0.5 and profilesSampleRate of 0.5 would | ||
// result in 25% of transactions being profiled (0.5*0.5=0.25) | ||
profilesSampleRate: 1.0, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288", | ||
|
||
// 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, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// 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"; | ||
// import { NodeProfilingIntegration } from "@sentry/profiling-node"; | ||
|
||
Sentry.init({ | ||
dsn: "https://fe4e4aa4a283391808a5da396da20159@o4505260022104064.ingest.us.sentry.io/4507946746380288", | ||
|
||
// 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, | ||
|
||
// Integrations | ||
integrations: [ | ||
Sentry.anrIntegration(), | ||
// NodeProfilingIntegration, | ||
// Sentry.fsIntegration(), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"use client"; | ||
|
||
import * as Sentry from "@sentry/nextjs"; | ||
import NextError from "next/error"; | ||
import { useEffect } from "react"; | ||
|
||
export default function GlobalError({ | ||
error, | ||
}: { | ||
error: Error & { digest?: string }; | ||
}) { | ||
useEffect(() => { | ||
Sentry.captureException(error); | ||
}, [error]); | ||
|
||
return ( | ||
<html> | ||
<body> | ||
{/* `NextError` is the default Next.js error page component. Its type | ||
definition requires a `statusCode` prop. However, since the App Router | ||
does not expose status codes for errors, we simply pass 0 to render a | ||
generic error message. */} | ||
<NextError statusCode={0} /> | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.