From 2bdc71af3f0f69db0aefaa46eb9d75dc48d9bcf6 Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Mon, 15 Aug 2022 15:00:13 +0000 Subject: [PATCH] http: Add content-based health check for upstream (#22212) Signed-off-by: Boteng Yao Mirrored from https://github.com/envoyproxy/envoy @ ea0eb2d5ea3f82250f3577c7ac5a898087d0799f --- envoy/config/core/v3/health_check.proto | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/envoy/config/core/v3/health_check.proto b/envoy/config/core/v3/health_check.proto index 9eb537f8..f4c9d857 100644 --- a/envoy/config/core/v3/health_check.proto +++ b/envoy/config/core/v3/health_check.proto @@ -75,12 +75,12 @@ message HealthCheck { // Hex encoded payload. E.g., "000000FF". string text = 1 [(validate.rules).string = {min_len: 1}]; - // [#not-implemented-hide:] Binary payload. + // Binary payload. bytes binary = 2; } } - // [#next-free-field: 14] + // [#next-free-field: 15] message HttpHealthCheck { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.HealthCheck.HttpHealthCheck"; @@ -103,8 +103,20 @@ message HealthCheck { // [#not-implemented-hide:] HTTP specific payload. Payload send = 3; - // [#not-implemented-hide:] HTTP specific response. - Payload receive = 4; + // Specifies a list of HTTP expected responses to match in the first ``response_buffer_size`` bytes of the response body. + // If it is set, both the expected response check and status code determine the health check. + // When checking the response, “fuzzy” matching is performed such that each payload block must be found, + // and in the order specified, but not necessarily contiguous. + // + // .. note:: + // + // It is recommended to set ``response_buffer_size`` based on the total Payload size for efficiency. + // The default buffer size is 1024 bytes when it is not set. + repeated Payload receive = 4; + + // Specifies the size of response buffer in bytes that is used to Payload match. + // The default value is 1024. Setting to 0 implies that the Payload will be matched against the entire response. + google.protobuf.UInt64Value response_buffer_size = 14 [(validate.rules).uint64 = {gte: 0}]; // Specifies a list of HTTP headers that should be added to each request that is sent to the // health checked cluster. For more information, including details on header value syntax, see @@ -161,7 +173,7 @@ message HealthCheck { Payload send = 1; // When checking the response, “fuzzy” matching is performed such that each - // binary block must be found, and in the order specified, but not + // payload block must be found, and in the order specified, but not // necessarily contiguous. repeated Payload receive = 2; }