import { randomUUID } from "node:crypto";
import { env } from "../../config/env";
export function requestContext(req, _res, next) {
    const requestId = req.header(env.TRACE_HEADER) ||
        req.header("x-trace-id") ||
        randomUUID();
    const traceId = req.header("x-trace-id") || requestId;
    req.requestId = requestId;
    req.traceId = traceId;
    next();
}
