Integrierte Observability in SvelteKit
SvelteKit bietet jetzt erstklassige Unterstützung für OpenTelemetry-Tracing und eine dedizierte Instrumentierungsdatei, die über die svelte.config.js aktiviert werden kann.
Understanding how your SvelteKit application behaves in production — from request flows to performance bottlenecks — is crucial for building reliable user experiences. SvelteKit now has first-class support for observability: built-in OpenTelemetry tracing, and a dedicated instrumentation setup file that ensures your monitoring tools work seamlessly.
To opt in, upgrade SvelteKit and your adapter and add the following to your svelte.config.js:
svelte.config
export default {
kit(property) kit: {
experimental: {
tracing: {
server: boolean;
};
instrumentation: {
server: boolean;
};
};
}: {
experimental(property) experimental: {
tracing: {
server: boolean;
};
instrumentation: {
server: boolean;
};
}: {
tracing(property) tracing: {
server: boolean;
}: {
server(property) server: boolean: true
},
instrumentation(property) instrumentation: {
server: boolean;
}: {
server(property) server: boolean: true
}
}
}
};
First-party OpenTelemetry traces
SvelteKit can now emit OpenTelemetry traces for the following:
handlehook (handlefunctions running in asequencewill show up as children of each other and the root handle hook) …