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. 🤓