0.1.6 • Published 3 months ago
@baselime/sveltekit-opentelemetry-middleware v0.1.6
Svelte Kit OpenTelemetry Middleware
A streamlined OpenTelemetry Middleware for SvelteKit
Getting Started
Install the packages
npm i @baselime/node-opentelemetry @baselime/sveltekit-opentelemetry-middleware
Add the following code to your root.server.{ts|js}
import { withOpenTelemetry } from '@baselime/sveltekit-opentelemetry-middleware'
import { BaselimeSDK } from '@baselime/node-opentelemetry';
new BaselimeSDK({}).start();
export const handle = withOpenTelemetry(async ({ event, resolve }) => {
return resolve(event);
});
To configure the BaselimeSDK visit the documentation
Options
The withOpenTelemetry function takes the following options
Parameter | Type | Description |
---|---|---|
captureRequestBody | boolean | Capture the request body in the span. (Optional) |
captureResponseBody | boolean | Capture the response body in the span. (Optional) |
requestIdHeader | string | The header to look for the request id in. By default it will check x-request-id and x-vercel |
License
© Baselime Limited, 2023
Distributed under MIT License (The MIT License
).
See LICENSE for more information.