/** * Correlation ID — request_id propagation via AsyncLocalStorage. * * Usage: * - On each incoming HTTP request: call runWithRequestId(uuid, fn) * - Anywhere in the call stack: call getRequestId() to retrieve the current ID * - child loggers can bind it via logger.child({ request_id: getRequestId() }) */ import { randomUUID } from 'node:crypto'; export { randomUUID }; /** * Run fn inside a context that has request_id set. * Callers that do not call this will see undefined from getRequestId(). */ export declare function runWithRequestId(requestId: string, fn: () => T): T; /** * Retrieve the current request_id from the async context. * Returns undefined when called outside a runWithRequestId scope. */ export declare function getRequestId(): string | undefined; /** * Generate a new RFC 4122 v4 UUID suitable for use as a request_id. */ export declare function newRequestId(): string;