Skip to content

Commit f86ffdf

Browse files
authored
Merge pull request #16125 from ethereum/sentry-optimize
Sentry optimization
2 parents 16b0b80 + c673633 commit f86ffdf

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

instrumentation-client.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import * as Sentry from "@sentry/nextjs"
22

33
const environment = process.env.NEXT_PUBLIC_CONTEXT || "development"
44

5-
Sentry.init({
6-
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
7-
tracesSampleRate: 1,
8-
debug: environment === "development",
9-
environment,
10-
})
5+
if (environment === "production") {
6+
Sentry.init({
7+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
8+
tracesSampleRate: 0.1,
9+
debug: false,
10+
environment,
11+
})
12+
}
1113

1214
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart

sentry.edge.config.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import * as Sentry from "@sentry/nextjs"
22

33
const environment = process.env.NEXT_PUBLIC_CONTEXT || "development"
44

5-
Sentry.init({
6-
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
7-
tracesSampleRate: 1,
8-
debug: environment === "development",
9-
environment,
10-
})
5+
if (environment === "production") {
6+
Sentry.init({
7+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
8+
tracesSampleRate: 0.1,
9+
debug: false,
10+
environment,
11+
})
12+
}

sentry.server.config.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import * as Sentry from "@sentry/nextjs"
22

33
const environment = process.env.NEXT_PUBLIC_CONTEXT || "development"
44

5-
Sentry.init({
6-
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
7-
tracesSampleRate: 1,
8-
debug: environment === "development",
9-
environment,
10-
})
5+
if (environment === "production") {
6+
Sentry.init({
7+
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
8+
tracesSampleRate: 0.1,
9+
debug: false,
10+
environment,
11+
})
12+
}

0 commit comments

Comments
 (0)