Skip to content

Commit 1edb8d4

Browse files
oops
1 parent d1a5cdc commit 1edb8d4

File tree

3 files changed

+128
-42
lines changed

3 files changed

+128
-42
lines changed

apps/svelte.dev/content/blog/2025-08-14-sveltekit-integrated-observability.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,24 @@ If there are additional attributes you think might be useful, please file an iss
3737

3838
## A convenient home for all of your instrumentation
3939

40-
Emitting traces alone is not enough: You also need to collect them and send them somewhere. Under normal circumstances, this can be a bit challenging. Because of the nature of observability instrumentation, it needs to be loaded prior to loading any of the code from your app. To aid in this, SvelteKit now supports a `src/instrumentation.server.ts` file which, assuming your adapter supports it, is guaranteed to be loaded prior to your application code. In Node, your instrumentation might look something like this:
40+
Emitting traces alone is not enough: You also need to collect them and send them somewhere. Under normal circumstances, this can be a bit challenging. Because of the nature of observability instrumentation, it needs to be loaded prior to loading any of the code from your app. To aid in this, SvelteKit now supports a `src/instrumentation.server.ts` file which, assuming your adapter supports it, is guaranteed to be loaded prior to your application code.
41+
42+
To enable `instrumentation.server.ts`, add the following to your `svelte.config.js`:
43+
44+
```js
45+
/// file: svelte.config.js
46+
export default {
47+
kit: {
48+
+++experimental: {
49+
instrumentation: {
50+
server: true
51+
}
52+
}+++
53+
}
54+
};
55+
```
56+
57+
In Node, your instrumentation might look something like this:
4158

4259
```ts
4360
import { NodeSDK } from '@opentelemetry/sdk-node';

apps/svelte.dev/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"satori": "^0.10.13",
7373
"satori-html": "^0.3.2",
7474
"sv": "^0.6.8",
75-
"svelte": "^5.35.5",
75+
"svelte": "link:../../../svelte/packages/svelte",
7676
"svelte-check": "^4.1.1",
7777
"svelte-preprocess": "^6.0.3",
7878
"tiny-glob": "^0.2.9",

pnpm-lock.yaml

Lines changed: 109 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)