diff --git a/env/client.ts b/env/client.ts index 5cbc6d072..7d52627d1 100644 --- a/env/client.ts +++ b/env/client.ts @@ -6,7 +6,7 @@ export const env = createEnv({ NEXT_PUBLIC_NODE_ENV: z.enum(["development", "test", "production"]), NEXT_PUBLIC_PORT: z.string().default("3000"), NEXT_PUBLIC_SENTRY_ENVIRONMENT: z.string().default("development"), - NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE: z.coerce.number().default(0.01), + NEXT_PUBLIC_SENTRY_CLIENT_SAMPLERATE: z.coerce.number().default(0.001), NEXT_PUBLIC_HIDE_FOR_NEXT_RELEASE: z .string() // only allow "true" or "false" diff --git a/env/server.ts b/env/server.ts index fa084feb0..831e60df6 100644 --- a/env/server.ts +++ b/env/server.ts @@ -130,7 +130,7 @@ export const env = createEnv({ .transform((s) => s === "true") .default("false"), SENTRY_ENVIRONMENT: z.string().default("development"), - SENTRY_SERVER_SAMPLERATE: z.coerce.number().default(0.01), + SENTRY_SERVER_SAMPLERATE: z.coerce.number().default(0.001), }, emptyStringAsUndefined: true, runtimeEnv: { diff --git a/sentry.client.config.ts b/sentry.client.config.ts index 18dc74199..5be65646d 100644 --- a/sentry.client.config.ts +++ b/sentry.client.config.ts @@ -1,6 +1,7 @@ import * as Sentry from "@sentry/nextjs" import { env } from "./env/client" +import { denyUrls } from "./sentry.shared.config" Sentry.init({ dsn: "https://fe39c070b4154e2f9cc35f0e5de0aedb@o4508102497206272.ingest.de.sentry.io/4508102500286544", @@ -14,4 +15,5 @@ Sentry.init({ // 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: 0.01, + denyUrls: [...denyUrls], }) diff --git a/sentry.edge.config.ts b/sentry.edge.config.ts index 2a9588495..ac13f84c7 100644 --- a/sentry.edge.config.ts +++ b/sentry.edge.config.ts @@ -1,6 +1,7 @@ import * as Sentry from "@sentry/nextjs" import { env } from "./env/server" +import { denyUrls } from "./sentry.shared.config" Sentry.init({ dsn: "https://fe39c070b4154e2f9cc35f0e5de0aedb@o4508102497206272.ingest.de.sentry.io/4508102500286544", @@ -8,4 +9,5 @@ Sentry.init({ enabled: env.SENTRY_ENVIRONMENT !== "development", tracesSampleRate: env.SENTRY_SERVER_SAMPLERATE, + denyUrls: [...denyUrls], }) diff --git a/sentry.server.config.ts b/sentry.server.config.ts index 81bcef646..eefd1919c 100644 --- a/sentry.server.config.ts +++ b/sentry.server.config.ts @@ -1,10 +1,12 @@ import * as Sentry from "@sentry/nextjs" import { env } from "./env/server" +import { denyUrls } from "./sentry.shared.config" Sentry.init({ dsn: "https://fe39c070b4154e2f9cc35f0e5de0aedb@o4508102497206272.ingest.de.sentry.io/4508102500286544", environment: env.SENTRY_ENVIRONMENT, enabled: env.SENTRY_ENVIRONMENT !== "development", tracesSampleRate: env.SENTRY_SERVER_SAMPLERATE, + denyUrls: [...denyUrls], }) diff --git a/sentry.shared.config.ts b/sentry.shared.config.ts new file mode 100644 index 000000000..294afd850 --- /dev/null +++ b/sentry.shared.config.ts @@ -0,0 +1,4 @@ +export const denyUrls: (string | RegExp)[] = [ + // Ignore preview urls + /\/.{2}\/preview\//, +]