Skip to content

Commit 8d988ee

Browse files
committed
feat(js): Document how to disable tracing
1 parent 4f22f41 commit 8d988ee

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

docs/platforms/javascript/common/configuration/tree-shaking.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Replacing this flag with `false` will tree shake any SDK code that's related to
120120

121121
<Alert>
122122
`__SENTRY_TRACING__` must not be replaced with `false` when you're using any
123-
tracing-related SDK features (for example,`Sentry.startTransaction()`). This
123+
tracing-related SDK features (for example,`Sentry.startSpan()`). This
124124
flag is intended to be used in combination with packages like `@sentry/next`
125125
or `@sentry/sveltekit`, which automatically include the tracing functionality.
126126
</Alert>

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

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ With [tracing](/product/insights/overview/), Sentry automatically tracks your so
3131
## Configure
3232

3333
<PlatformSection supported={["javascript"]}>
34-
Enable tracing by configuring the sampling rate for transactions. Set the
35-
sample rate for your transactions by either:
34+
Enable tracing by configuring the sampling rate for traces. Set the sample
35+
rate as follows:
3636
</PlatformSection>
3737

3838
<PlatformSection notSupported={["javascript"]}>
39-
Enable tracing by setting the sample rate for your transactions.
39+
Enable tracing by setting the sample rate for your traces.
4040
</PlatformSection>
4141

4242
<PlatformContent includePath="performance/configure-sample-rate" />
@@ -75,13 +75,36 @@ See <PlatformLink to="/tracing/instrumentation/automatic-instrumentation">Automa
7575

7676
You can also manually start spans to instrument specific parts of your code. This is useful when you want to measure the performance of a specific operation or function.
7777

78-
- <PlatformLink to="/apis/#tracing">Tracing APIs</PlatformLink>:
79-
Find information about APIs for custom tracing instrumentation
78+
- <PlatformLink to="/apis/#tracing">Tracing APIs</PlatformLink>: Find
79+
information about APIs for custom tracing instrumentation
8080
- <PlatformLink to="/tracing/instrumentation/">Instrumentation</PlatformLink>:
8181
Find information about manual instrumentation with the Sentry SDK
8282
- <PlatformLink to="/tracing/span-metrics/">Sending Span Metrics</PlatformLink>:
8383
Learn how to capture metrics on your spans
8484

85+
## Disabling Tracing
86+
87+
If you want to disable tracing, you _should not_ set `tracesSampleRate` at
88+
all. Setting it to `0` will not disable tracing, it will simply never send any
89+
traces to Sentry.
90+
91+
<PlatformSection
92+
supported={[
93+
"javascript.nextjs",
94+
"javascript.nuxt",
95+
"javascript.sveltekit",
96+
"javascript.astro",
97+
"javascript.solidstart",
98+
]}
99+
>
100+
In addition, you can configure `__SENTRY_TRACING__` to ensure the tracing code
101+
is removed from your production build. This will result in{" "}
102+
<PlatformLink to="/tracing/distributed-tracing/">trace propagation</PlatformLink>{" "}
103+
being disabled as well. See{" "}
104+
<PlatformLink to="/configuration/tree-shaking/">Tree Shaking</PlatformLink>{" "}
105+
for more information.
106+
</PlatformSection>
107+
85108
## Next Steps
86109

87110
<PageGrid />

0 commit comments

Comments
 (0)