Skip to content

Commit c1d9a1b

Browse files
committed
update tracing page
1 parent 03bfa7e commit c1d9a1b

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed
Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,45 @@
1-
Set `tracesSampleRate` in your config files, `instrumentation-client.js`, `sentry.server.config.js`, and `sentry.edge.config.js`:
1+
Set `tracesSampleRate` in your config files:
2+
- `sentry.server.config.js`
3+
- `sentry.edge.config.js`:
4+
- `instrumentation-client.js`
5+
- If you previously had file called `sentry.client.config.(js|ts)`, you can also safely rename this to `instrumentation-client.(js|ts)` for all Next.js versions.
26

3-
```javascript
7+
```javascript {tabTitle:Client} {filename:instrumentation-client.(js|ts)}
48
import * as Sentry from "@sentry/nextjs";
59

610
Sentry.init({
711
dsn: "___PUBLIC_DSN___",
12+
// We recommend adjusting this value in production, or using `tracesSampler`
13+
// for finer control
14+
tracesSampleRate: 1.0,
15+
// ... rest of your config
16+
});
17+
18+
// This export will instrument router navigations, and is only relevant if you enable tracing.
19+
// `captureRouterTransitionStart` is available from SDK version 9.12.0 onwards
20+
export const onRouterTransitionStart = Sentry.captureRouterTransitionStart;
21+
```
22+
23+
```javascript {tabTitle:Server} {filename:sentry.server.config.(js|ts)}
24+
import * as Sentry from "@sentry/nextjs";
825

26+
Sentry.init({
27+
dsn: "___PUBLIC_DSN___",
928
// We recommend adjusting this value in production, or using `tracesSampler`
1029
// for finer control
1130
tracesSampleRate: 1.0,
31+
// ... rest of your config
1232
});
1333
```
34+
35+
```javascript {tabTitle:Edge} {filename:sentry.edge.config.(js|ts)}
36+
import * as Sentry from "@sentry/nextjs";
37+
38+
Sentry.init({
39+
dsn: "___PUBLIC_DSN___",
40+
// We recommend adjusting this value in production, or using `tracesSampler`
41+
// for finer control
42+
tracesSampleRate: 1.0,
43+
// ... rest of your config
44+
});
45+
```

0 commit comments

Comments
 (0)