Function: getRequestId()
getRequestId(Defined in: packages/http/src/security.ts:114 Resolve the request ID for an inbound request — passing through any caller-supplied value verbatim, otherwise minting a fresh UUID v4 viaexistingId?):string
crypto.randomUUID().
Use as the source of truth for the per-request correlation ID written
into log lines, response headers (x-request-id), and downstream
service hops. Trusting an upstream-supplied ID lets distributed
traces follow the request across service boundaries without
regeneration.
Parameters
existingId?
string
Inbound x-request-id (or equivalent), if any.
Returned unchanged when truthy; no validation is applied, so do not
echo untrusted values into log structures without your own
sanitization.
Returns
string
The supplied ID, or a freshly generated UUID v4.