router: add x-envoy-attempt-count on downstream responses (#10325)

Description: this PR adds the `x-envoy-attempt-count` header to downstream responses.
Risk Level: low, used via new config value that defaults to false.
Testing: updated tests to verify that the header is being set. New unit tests
Docs Changes: updated docs
Release Notes: added.

Signed-off-by: Jose Nino <jnino@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 1db15db60af37b167b72e3c5e653ffdda9711336
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent 012010073d
commit a95f35fc43
  1. 14
      envoy/api/v2/route/route_components.proto
  2. 14
      envoy/config/route/v3/route_components.proto

@ -32,7 +32,7 @@ option (udpa.annotations.file_migrate).move_to_package = "envoy.config.route.v3"
// host header. This allows a single listener to service multiple top level domain path trees. Once
// a virtual host is selected based on the domain, the routes are processed in order to see which
// upstream cluster to route to or whether to perform a redirect.
// [#next-free-field: 19]
// [#next-free-field: 20]
message VirtualHost {
enum TlsRequirementType {
// No TLS requirement for the virtual host.
@ -143,8 +143,20 @@ message VirtualHost {
// This header is unaffected by the
// :ref:`suppress_envoy_headers
// <envoy_api_field_config.filter.http.router.v2.Router.suppress_envoy_headers>` flag.
//
// [#next-major-version: rename to include_attempt_count_in_request.]
bool include_request_attempt_count = 14;
// Decides whether the :ref:`x-envoy-attempt-count
// <config_http_filters_router_x-envoy-attempt-count>` header should be included
// in the downstream response. Setting this option will cause the router to override any existing header
// value, so in the case of two Envoys on the request path with this option enabled, the downstream
// will see the attempt count as perceived by the Envoy closest upstream from itself. Defaults to false.
// This header is unaffected by the
// :ref:`suppress_envoy_headers
// <envoy_api_field_config.filter.http.router.v2.Router.suppress_envoy_headers>` flag.
bool include_attempt_count_in_response = 19;
// Indicates the retry policy for all routes in this virtual host. Note that setting a
// route level entry will take precedence over this config and it'll be treated
// independently (e.g.: values are not inherited).

@ -32,7 +32,7 @@ option java_multiple_files = true;
// host header. This allows a single listener to service multiple top level domain path trees. Once
// a virtual host is selected based on the domain, the routes are processed in order to see which
// upstream cluster to route to or whether to perform a redirect.
// [#next-free-field: 19]
// [#next-free-field: 20]
message VirtualHost {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.route.VirtualHost";
@ -140,8 +140,20 @@ message VirtualHost {
// This header is unaffected by the
// :ref:`suppress_envoy_headers
// <envoy_api_field_extensions.filters.http.router.v3.Router.suppress_envoy_headers>` flag.
//
// [#next-major-version: rename to include_attempt_count_in_request.]
bool include_request_attempt_count = 14;
// Decides whether the :ref:`x-envoy-attempt-count
// <config_http_filters_router_x-envoy-attempt-count>` header should be included
// in the downstream response. Setting this option will cause the router to override any existing header
// value, so in the case of two Envoys on the request path with this option enabled, the downstream
// will see the attempt count as perceived by the Envoy closest upstream from itself. Defaults to false.
// This header is unaffected by the
// :ref:`suppress_envoy_headers
// <envoy_api_field_extensions.filters.http.router.v3.Router.suppress_envoy_headers>` flag.
bool include_attempt_count_in_response = 19;
// Indicates the retry policy for all routes in this virtual host. Note that setting a
// route level entry will take precedence over this config and it'll be treated
// independently (e.g.: values are not inherited).

Loading…
Cancel
Save