Skip to content

Commit db35b55

Browse files
authored
docs: clarify x-request-id generation and preservation behavior (#43949)
## Description Clarifies how `generate_request_id`, `use_remote_address`, and `preserve_external_request_id` interact to control `x-request-id` header handling. Adds a note to the headers documentation describing each setting's role and summarizes the resulting behavior for each combination. This picks up and expands the work from #37616 (stale-closed), incorporating reviewer feedback from @wbpcode to also cover `generate_request_id` and to clarify that `preserve_external_request_id` only applies when `use_remote_address` is `true`. Relates to #36971. --- **Commit Message:** docs: clarify x-request-id generation and preservation behavior **Risk Level:** N/A (docs only) **Testing:** N/A **Docs Changes:** Added note block to `docs/root/configuration/http/http_conn_man/headers.rst` **Release Notes:** N/A Signed-off-by: kovan <xaum.io@gmail.com>
1 parent 9a7db4c commit db35b55

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

docs/root/configuration/http/http_conn_man/headers.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,39 @@ following features are available:
556556
See the architecture overview on
557557
:ref:`context propagation <arch_overview_tracing_context_propagation>` for more information.
558558

559+
.. note::
560+
561+
Three configuration settings control ``x-request-id`` generation and preservation:
562+
563+
:ref:`generate_request_id <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.generate_request_id>`
564+
When ``true`` (the default), Envoy generates a new ``x-request-id`` for requests that
565+
do not already have one. When ``false``, the entire request ID generation and mutation
566+
logic is skipped. Disabling this can reduce overhead in high-throughput scenarios where
567+
request ID tracking is not needed.
568+
569+
:ref:`use_remote_address <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.use_remote_address>`
570+
When ``true``, Envoy uses the downstream connection's remote address to determine whether
571+
a request is an *edge request* (i.e., from an external client). For edge requests, Envoy
572+
replaces any existing ``x-request-id`` with a newly generated value by default. When
573+
``false`` (the default), requests are never treated as edge requests, so any existing
574+
``x-request-id`` is preserved.
575+
576+
:ref:`preserve_external_request_id <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.preserve_external_request_id>`
577+
When ``true``, Envoy keeps an existing ``x-request-id`` on edge requests rather than
578+
replacing it. This setting only has an effect when ``use_remote_address`` is ``true``,
579+
since edge requests cannot occur otherwise.
580+
581+
The resulting behavior is:
582+
583+
* **No ``x-request-id`` in the request** -- Envoy generates a new UUID (if
584+
``generate_request_id`` is enabled).
585+
* **``x-request-id`` present, non-edge request** (``use_remote_address`` is ``false``, or
586+
the downstream address is internal) -- Envoy preserves the existing value.
587+
* **``x-request-id`` present, edge request, ``preserve_external_request_id`` is ``false``**
588+
-- Envoy replaces the value with a new UUID.
589+
* **``x-request-id`` present, edge request, ``preserve_external_request_id`` is ``true``**
590+
-- Envoy preserves the existing value.
591+
559592
.. _config_http_conn_man_headers_x-ot-span-context:
560593

561594
x-ot-span-context

0 commit comments

Comments
 (0)