Skip to content

Commit c79aae6

Browse files
authored
ref(sveltekit): Clarify limitations of auto instrumentation for Kit<2.31.0 (#15592)
Clarify that auto instrumentation will not work correctly if a SvelteKit versions below 2.31.0 are used. This came up in getsentry/sentry-javascript#18247. Note: I intentionally opted not to show the `--import` alternative I mentioned in the issue because it would be a 3rd (already outdated) way of setting up the SDK. Furthermore, success would vary greatly based on the used Kit adapter and deployment platform.
1 parent 469877f commit c79aae6

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

platform-includes/getting-started-complete/javascript.sveltekit.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,22 @@ You need:
99

1010
<Expandable title="I'm on an older SvelteKit version than 2.31.0">
1111

12-
Version `2.31.0` of SvelteKit introduces [official support for observability and tracing](https://svelte.dev/docs/kit/observability). This means that Sentry can now follow the official best practice for how the SDK should be set up.
13-
For you, this means:
12+
Version `2.31.0` of SvelteKit introduces [official support for observability and tracing](https://svelte.dev/docs/kit/observability).
13+
This means that Sentry can now follow the official best practice for how the SDK should be set up:
1414

15-
- The Sentry SDK will be initialized at the correct, earliest possible time on the server, allowing for all its auto-instrumentation to work correctly.
16-
- The Sentry SDK picks up spans emitted from SvelteKit directly. You'll get more accurate insights into the performance of your handlers, server actions, `load`, and remote functions.
15+
- The Sentry SDK will be initialized at the correct, earliest possible time on the server, allowing for all its auto-instrumentation to work correctly.
16+
This means, you will now get spans from auto instrumentation (e.g. database queries) automatically.
17+
- The Sentry SDK picks up spans emitted from SvelteKit directly.
18+
You'll get more accurate insights into the performance of your handlers, server actions, `load`, and remote functions.
1719

1820
SvelteKit observability is still an experimental feature in SvelteKit 2.x, but we recommend giving it a try.
1921
The Sentry wizard, as well as this guide, will use it as the default way of setting up the SDK.
2022

2123
<PlatformSection notSupported={["javascript.cloudflare"]}>
2224

23-
If you've already set up the SDK and don't want to migrate to the new setup, or don't want to upgrade to SvelteKit `2.31.0` or higher, that's fine too. Just follow [this guide](../manual-setup__v10.7.0) instead.
25+
If you've already set up the SDK and don't want to migrate to the new setup, or don't want to upgrade to SvelteKit `2.31.0` or higher, that's fine too.
26+
Just follow <PlatformLink to="/manual-setup__v10.7.0">this guide</PlatformLink> instead.
27+
However, note that auto instrumentation (e.g. for database queries) will not work.
2428

2529
</PlatformSection>
2630

platform-includes/getting-started-prerequisites/javascript.sveltekit.mdx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,20 @@ You need:
99

1010
<Expandable title="I'm on an older SvelteKit version than 2.31.0">
1111

12-
Version `2.31.0` of SvelteKit, introduces [official support for observability and tracing](https://svelte.dev/docs/kit/observability). This means that Sentry can now follow the official best practise for how the SDK should be set up.
13-
For you this means:
14-
- The Sentry SDK will be initialized at the correct, earliest possible time on the server, allowing for all its auto instrumentation to work correctly.
15-
- The Sentry SDK picks up spans emitted from SvelteKit directly. You'll get more accurate insights into the performance of your handlers, server actions, `load` and remote functions.
12+
Version `2.31.0` of SvelteKit introduces [official support for observability and tracing](https://svelte.dev/docs/kit/observability).
13+
This means that Sentry can now follow the official best practice for how the SDK should be set up:
1614

17-
SvelteKit observability is still an experimental feature in SvelteKit 2.x but we recommend giving it a try.
18-
The Sentry wizard, as well as our guides, will use it as the default way of setting up the SDK.
15+
- The Sentry SDK will be initialized at the correct, earliest possible time on the server, allowing for all its auto-instrumentation to work correctly.
16+
This means, you will now get spans from auto instrumentation (e.g. database queries) automatically.
17+
- The Sentry SDK picks up spans emitted from SvelteKit directly.
18+
You'll get more accurate insights into the performance of your handlers, server actions, `load`, and remote functions.
1919

20-
If you've already set up the SDK and don't want to migrate to the new setup, or don't want to upgrade to SvelteKit `2.31.0` or higher, that's fine too. Nothing will change for you!
20+
SvelteKit observability is still an experimental feature in SvelteKit 2.x, but we recommend giving it a try.
21+
The Sentry wizard, as well as this guide, will use it as the default way of setting up the SDK.
22+
23+
If you've already set up the SDK and don't want to migrate to the new setup, or don't want to upgrade to SvelteKit `2.31.0` or higher, that's fine too.
24+
Just follow <PlatformLink to="/manual-setup__v10.7.0">this guide</PlatformLink> instead.
25+
However, note that auto instrumentation (e.g. for database queries) will not work.
2126

2227
</Expandable>
2328

0 commit comments

Comments
 (0)