@sourceregistry/sveltekit-enhance 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
1
2
|
const durationMs = (startedAt) => Number(process.hrtime.bigint() - startedAt) / 1_000_000;
|
|
2
3
|
const resolveRoute = (event) => event.route.id ?? event.url.pathname;
|
|
3
4
|
export const RequestMonitor = {
|
|
@@ -5,7 +6,11 @@ export const RequestMonitor = {
|
|
|
5
6
|
const { logger = console, record, } = options;
|
|
6
7
|
return async (event) => {
|
|
7
8
|
const locals = event.locals;
|
|
8
|
-
const requestId = locals.
|
|
9
|
+
const requestId = locals.correlation_id ??
|
|
10
|
+
locals.request_id ??
|
|
11
|
+
event.request.headers.get('x-correlation-id') ??
|
|
12
|
+
event.request.headers.get('x-request-id') ??
|
|
13
|
+
randomUUID();
|
|
9
14
|
const route = resolveRoute(event);
|
|
10
15
|
locals.trace = {
|
|
11
16
|
id: requestId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sourceregistry/sveltekit-enhance",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Composable enhance and form utilities for SvelteKit actions, loads, methods, and hooks.",
|
|
5
5
|
"author": "A.P.A. Slaa (a.p.a.slaa@projectsource.nl)",
|
|
6
6
|
"scripts": {
|