0.1.6 • Published 3 months ago

@baselime/sveltekit-opentelemetry-middleware v0.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Svelte Kit OpenTelemetry Middleware

Documentation Latest Release License

A streamlined OpenTelemetry Middleware for SvelteKit

Svelte Trace

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

ParameterTypeDescription
captureRequestBodybooleanCapture the request body in the span. (Optional)
captureResponseBodybooleanCapture the response body in the span. (Optional)
requestIdHeaderstringThe 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.

0.1.4

3 months ago

0.1.3

3 months ago

0.1.6

3 months ago

0.1.5

3 months ago

0.1.2

3 months ago