From 9f05d82ba27b02ee39a8a2a8f1233ff7c57b299a Mon Sep 17 00:00:00 2001 From: Amishi Kaushal Date: Fri, 20 Feb 2026 12:38:10 +0530 Subject: [PATCH] Clarify usage of middleware for X-Request-ID request tracing --- docs/en/docs/tutorial/middleware.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/en/docs/tutorial/middleware.md b/docs/en/docs/tutorial/middleware.md index 123ce3a683..636053bada 100644 --- a/docs/en/docs/tutorial/middleware.md +++ b/docs/en/docs/tutorial/middleware.md @@ -59,6 +59,9 @@ For example, you could add a custom header `X-Process-Time` containing the time {* ../../docs_src/middleware/tutorial001_py310.py hl[10,12:13] *} +Middleware can also be used to add request tracing headers such as `X-Request-ID`. This is commonly used in production systems to uniquely identify and track requests across multiple services for debugging and observability. + + /// tip Here we use `time.perf_counter()` instead of `time.time()` because it can be more precise for these use cases. 🤓