Skip to content

Commit 4a7a698

Browse files
committed
clarify tracing docs for rr
1 parent d6aa086 commit 4a7a698

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed
Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
1-
```javascript
1+
To enable automatic tracing you need to update the configuration of your client and server instrumentation:
2+
- For client-side tracing, include the `reactRouterTracingIntegration` to your integrations array.
3+
- Additionally you need to set the `tracesSampleRate` in your `Sentry.init()` calls.
4+
5+
```javascript {tabTitle:Client} {filename:entry.client.tsx} {7,11}
26
import * as Sentry from "@sentry/react-router";
37

48
Sentry.init({
59
dsn: "___PUBLIC_DSN___",
610

7-
// This enables automatic instrumentation (highly recommended),
8-
// but is not necessary for purely manual usage
9-
// If you only want to use custom instrumentation:
10-
// * Remove the `reactRouterTracingIntegration` integration
11-
// * add `Sentry.addTracingExtensions()` above your Sentry.init() call
11+
// This enables automatic instrumentation for client-side navigations
1212
integrations: [Sentry.reactRouterTracingIntegration()],
1313

1414
// We recommend adjusting this value in production, or using tracesSampler
1515
// for finer control
1616
tracesSampleRate: 1.0,
1717

18-
// Set `tracePropagationTargets` to control for which URLs trace propagation should be enabled
19-
tracePropagationTargets: ["localhost", /^https:\/\/yourserver\.io\/api/],
18+
// ... rest of your config
19+
});
20+
21+
// ... rest of the file
22+
```
23+
24+
```javascript {tabTitle:Server} {filename:instrument.server.(mjs|ts)} {8}
25+
import * as Sentry from "@sentry/react-router";
26+
27+
Sentry.init({
28+
dsn: "___PUBLIC_DSN___",
29+
30+
// We recommend adjusting this value in production, or using tracesSampler
31+
// for finer control
32+
tracesSampleRate: 1.0,
33+
34+
// ... rest of your config
2035
});
2136
```

0 commit comments

Comments
 (0)