Skip to content

Commit 9a88980

Browse files
authored
feat(js): Add docs on how to disable distributed tracing (#10254)
1 parent f641ddb commit 9a88980

File tree

7 files changed

+83
-1
lines changed

7 files changed

+83
-1
lines changed

docs/platforms/javascript/common/distributed-tracing/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,8 @@ If you run any JavaScript applications in your distributed system, make sure tha
3333

3434
<PlatformContent includePath="distributed-tracing/how-to-use/" />
3535

36+
<Alert level="info" >
37+
3638
Remember that in order to propagate trace information through your whole distributed system, you have to use Sentry in all of the involved services and applications. Take a look at the respective SDK documentation to learn how distributed tracing can be enabled for each platform.
39+
40+
</Alert>

platform-includes/distributed-tracing/how-to-use/javascript.astro.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@ Sentry.init({
99
tracePropagationTargets: ["https://myproject.org", /^\/api\//],
1010
});
1111
```
12+
13+
### Disabling Distributed Tracing
14+
15+
If you want to disable distributed tracing and ensure no Sentry trace headers are sent, you can configure your SDK like this:
16+
17+
```javascript
18+
Sentry.init({
19+
dsn: "___PUBLIC_DSN___",
20+
21+
// Overwrite the defaults to ensure no trace headers are sent
22+
tracePropagationTargets: [],
23+
});
24+
```

platform-includes/distributed-tracing/how-to-use/javascript.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,16 @@ Sentry.init({
1313
If you don't want to use performance monitoring, you can set up <PlatformLink to="/distributed-tracing/custom-instrumentation/">Custom Instrumentation</PlatformLink> for distributed tracing.
1414

1515
If you're using version `7.57.x` or below, you'll need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> in order for distributed tracing to work.
16+
17+
### Disabling Distributed Tracing
18+
19+
If you want to disable distributed tracing and ensure no Sentry trace headers are sent, you can configure your SDK like this:
20+
21+
```javascript
22+
Sentry.init({
23+
dsn: "___PUBLIC_DSN___",
24+
25+
// Overwrite the defaults to ensure no trace headers are sent
26+
tracePropagationTargets: [],
27+
});
28+
```

platform-includes/distributed-tracing/how-to-use/javascript.nextjs.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,16 @@ Sentry.init({
1212
```
1313

1414
If you're using version `7.57.x` or below, you'll need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> in order for distributed tracing to work.
15+
16+
### Disabling Distributed Tracing
17+
18+
If you want to disable distributed tracing and ensure no Sentry trace headers are sent, you can configure your SDK like this:
19+
20+
```javascript
21+
Sentry.init({
22+
dsn: "___PUBLIC_DSN___",
23+
24+
// Overwrite the defaults to ensure no trace headers are sent
25+
tracePropagationTargets: [],
26+
});
27+
```

platform-includes/distributed-tracing/how-to-use/javascript.node.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,16 @@ Sentry.init({
1212
### Custom Instrumentation
1313

1414
If you don't want to use performance monitoring, you can set up <PlatformLink to="/distributed-tracing/custom-instrumentation/">Custom Instrumentation</PlatformLink> for distributed tracing.
15+
16+
### Disabling Distributed Tracing
17+
18+
If you want to disable distributed tracing and ensure no Sentry trace headers are sent, you can configure your SDK like this:
19+
20+
```javascript
21+
Sentry.init({
22+
dsn: "___PUBLIC_DSN___",
23+
24+
// Overwrite the defaults to ensure no trace headers are sent
25+
tracePropagationTargets: [],
26+
});
27+
```

platform-includes/distributed-tracing/how-to-use/javascript.remix.mdx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The `name` attributes must be the strings `"sentry-trace"` and `"baggage"` and t
3333

3434
To get around possible [Browser CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) issues, you should define `tracePropagationTargets` on the client side. See <PlatformLink to="/distributed-tracing/dealing-with-cors-issues/">Dealing with CORS Issues</PlatformLink> for more information.
3535

36-
```tsx
36+
```javascript
3737
// entry.client.tsx
3838
Sentry.init({
3939
dsn: "___PUBLIC_DSN___",
@@ -43,3 +43,16 @@ Sentry.init({
4343
```
4444

4545
If you're using version `7.57.x` or below, you'll need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> in order for distributed tracing to work.
46+
47+
### Disabling Distributed Tracing
48+
49+
If you want to disable distributed tracing and ensure no Sentry trace headers are sent, you can configure your SDK like this:
50+
51+
```javascript
52+
Sentry.init({
53+
dsn: "___PUBLIC_DSN___",
54+
55+
// Overwrite the defaults to ensure no trace headers are sent
56+
tracePropagationTargets: [],
57+
});
58+
```

platform-includes/distributed-tracing/how-to-use/javascript.sveltekit.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,16 @@ Sentry.init({
1010
```
1111

1212
If you're using version `7.57.x` or below, you'll need to have our <PlatformLink to="/performance/">performance monitoring feature enabled</PlatformLink> for distributed tracing to work.
13+
14+
### Disabling Distributed Tracing
15+
16+
If you want to disable distributed tracing and ensure no Sentry trace headers are sent, you can configure your SDK like this:
17+
18+
```javascript
19+
Sentry.init({
20+
dsn: "___PUBLIC_DSN___",
21+
22+
// Overwrite the defaults to ensure no trace headers are sent
23+
tracePropagationTargets: [],
24+
});
25+
```

0 commit comments

Comments
 (0)