Browse Source

Clarify usage of middleware for X-Request-ID request tracing

pull/14947/head
Amishi Kaushal 5 months ago
committed by GitHub
parent
commit
9f05d82ba2
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      docs/en/docs/tutorial/middleware.md

3
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 <a href="https://docs.python.org/3/library/time.html#time.perf_counter" class="external-link" target="_blank">`time.perf_counter()`</a> instead of `time.time()` because it can be more precise for these use cases. 🤓

Loading…
Cancel
Save