Skip to main content

Module request_id

Module request_id 

Source
Expand description

Per-request correlation id.

request_id is an axum middleware that assigns every request a RequestId (honouring an inbound x-request-id when present), stores it in the request extensions for extractors and the permission guard to read, and echoes it on the response. Problem carries it in the body so a client can quote one id to an operator.

Structs§

RequestId
A request’s correlation id, stored in the request extensions by request_id and readable by extractors via RequestIdExt.

Constants§

REQUEST_ID_HEADER
The header carrying the correlation id, in and out.

Traits§

RequestIdExt
Convenience to read the RequestId out of a set of request extensions.

Functions§

request_id
Middleware that assigns a RequestId, stores it in the extensions and echoes it on the response’s x-request-id header. Reuses an inbound x-request-id when the client sent a syntactically valid one.