generated from betagouv/template-nextjs
-
Notifications
You must be signed in to change notification settings - Fork 0
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
16 changed files
with
1,180 additions
and
342 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 |
---|---|---|
|
@@ -61,3 +61,6 @@ robots.txt | |
/playwright-report/ | ||
/blob-report/ | ||
/playwright/.cache/ | ||
|
||
# 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
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 |
---|---|---|
@@ -1,19 +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. | ||
// 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"; | ||
|
||
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; | ||
const SENTRY_ENV = process.env.SENTRY_ENV || process.env.NEXT_PUBLIC_SENTRY_ENV; | ||
|
||
Sentry.init({ | ||
dsn: SENTRY_DSN ?? "", | ||
environment: SENTRY_ENV ?? "development", | ||
// Adjust this value in production, or use tracesSampler for greater control | ||
tracesSampleRate: 0.1, | ||
// ... | ||
// 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 | ||
dsn: "https://[email protected]/159", | ||
|
||
// 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 |
---|---|---|
@@ -1,19 +1,16 @@ | ||
// This file configures the initialization of Sentry on the browser. | ||
// The config you add here will be used whenever a page is visited. | ||
// 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"; | ||
|
||
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; | ||
const SENTRY_ENV = process.env.SENTRY_ENV || process.env.NEXT_PUBLIC_SENTRY_ENV; | ||
|
||
Sentry.init({ | ||
dsn: SENTRY_DSN ?? "", | ||
environment: SENTRY_ENV ?? "development", | ||
// Adjust this value in production, or use tracesSampler for greater control | ||
tracesSampleRate: 0.1, | ||
// ... | ||
// 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 | ||
dsn: "https://[email protected]/159", | ||
|
||
// 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 |
---|---|---|
|
@@ -4,20 +4,12 @@ | |
|
||
import * as Sentry from "@sentry/nextjs"; | ||
|
||
const SENTRY_DSN = process.env.SENTRY_DSN || process.env.NEXT_PUBLIC_SENTRY_DSN; | ||
const SENTRY_ENV = process.env.SENTRY_ENV || process.env.NEXT_PUBLIC_SENTRY_ENV; | ||
|
||
Sentry.init({ | ||
dsn: SENTRY_DSN ?? "", | ||
environment: SENTRY_ENV ?? "development", | ||
// Adjust this value in production, or use tracesSampler for greater control | ||
tracesSampleRate: 0.1, | ||
dsn: "https://[email protected]/159", | ||
|
||
// Define how likely traces are sampled. Adjust this value in production, or use tracesSampler for greater control. | ||
tracesSampleRate: 1, | ||
|
||
// remove healthz probes | ||
beforeSendTransaction: (event, hint) => { | ||
if (event?.request?.url?.endsWith("/healthz")) { | ||
return null; | ||
} | ||
return event; | ||
}, | ||
// 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,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; |
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
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,5 @@ | ||
// A faulty API route to test Sentry's error monitoring | ||
export default function handler(_req, res) { | ||
throw new Error("Sentry Example API Route Error"); | ||
res.status(200).json({ name: "John Doe" }); | ||
} |
Oops, something went wrong.