/** * A Next.js server's half of a page's trace (utils README, "Web pages"). A * request a page made carries the page's `traceparent` (log/web sets it on * every same-origin fetch), so what the server does under these wrappers is * a child of that request, in the page's trace: * * export const POST = traced("POST /api/vote", async (s, request) => { * await s.span("turso insert vote", () => db.execute(...)) * return Response.json({ ok: true }) * }) * * // in a "use server" file * export const vote = tracedAction("vote", async (s, id: string) => { ... }) * * A request with no traceparent is a root span of its own. Each wrapper hands * flushLog to `after`, so a serverless instance frozen once its response is * sent never holds unsent events (LOG_SHIP, set on the deployment, is where * they go). */ import { type Span } from "../universal/log.js"; /** A route handler whose work is a span, joined to the caller's trace. */ export declare function traced(name: string, handler: (s: Span, request: Request, ...rest: A) => Promise): (request: Request, ...rest: A) => Promise; /** A server action whose work is a span, joined to the trace of the page that called it. */ export declare function tracedAction(name: string, action: (s: Span, ...args: A) => Promise): (...args: A) => Promise; //# sourceMappingURL=log.d.ts.map