hc: add health event sink interface and file sink implementation (#27419)

* add access log to health check

Signed-off-by: Boteng Yao <boteng@google.com>

Mirrored from https://github.com/envoyproxy/envoy @ 881bc030a8f1cdc904311de6c1cdba38ef8cc98a
pull/626/head
data-plane-api(Azure Pipelines) 2 years ago
parent 20cb8b44bb
commit e3de64f451
  1. 1
      BUILD
  2. 18
      envoy/config/core/v3/health_check.proto
  3. 9
      envoy/extensions/health_check/event_sinks/file/v3/BUILD
  4. 22
      envoy/extensions/health_check/event_sinks/file/v3/file.proto
  5. 1
      versioning/BUILD

@ -235,6 +235,7 @@ proto_library(
"//envoy/extensions/formatter/cel/v3:pkg",
"//envoy/extensions/formatter/metadata/v3:pkg",
"//envoy/extensions/formatter/req_without_query/v3:pkg",
"//envoy/extensions/health_check/event_sinks/file/v3:pkg",
"//envoy/extensions/health_checkers/redis/v3:pkg",
"//envoy/extensions/health_checkers/thrift/v3:pkg",
"//envoy/extensions/http/cache/file_system_http_cache/v3:pkg",

@ -4,6 +4,7 @@ package envoy.config.core.v3;
import "envoy/config/core/v3/base.proto";
import "envoy/config/core/v3/event_service_config.proto";
import "envoy/config/core/v3/extension.proto";
import "envoy/type/matcher/v3/string.proto";
import "envoy/type/v3/http.proto";
import "envoy/type/v3/range.proto";
@ -13,6 +14,7 @@ import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/wrappers.proto";
import "envoy/annotations/deprecation.proto";
import "udpa/annotations/status.proto";
import "udpa/annotations/versioning.proto";
import "validate/validate.proto";
@ -60,7 +62,7 @@ message HealthStatusSet {
[(validate.rules).repeated = {items {enum {defined_only: true}}}];
}
// [#next-free-field: 25]
// [#next-free-field: 26]
message HealthCheck {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.core.HealthCheck";
@ -366,9 +368,19 @@ message HealthCheck {
// The default value for "healthy edge interval" is the same as the default interval.
google.protobuf.Duration healthy_edge_interval = 16 [(validate.rules).duration = {gt {}}];
// .. attention::
// This field is deprecated in favor of the extension
// :ref:`event_logger <envoy_v3_api_field_config.core.v3.HealthCheck.event_logger>` and
// :ref:`event_log_path <envoy_v3_api_field_extensions.health_check.event_sinks.file.v3.HealthCheckEventFileSink.event_log_path>`
// in the file sink extension.
//
// Specifies the path to the :ref:`health check event log <arch_overview_health_check_logging>`.
// If empty, no event log will be written.
string event_log_path = 17;
string event_log_path = 17
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
// A list of event log sinks to process the health check event.
// [#extension-category: envoy.health_check.event_sinks]
repeated TypedExtensionConfig event_logger = 25;
// [#not-implemented-hide:]
// The gRPC service for the health check event service.

@ -0,0 +1,9 @@
# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py.
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")
licenses(["notice"]) # Apache 2
api_proto_package(
deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"],
)

@ -0,0 +1,22 @@
syntax = "proto3";
package envoy.extensions.health_check.event_sinks.file.v3;
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.health_check.event_sinks.file.v3";
option java_outer_classname = "FileProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/health_check/event_sinks/file/v3;filev3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Health Check Log File Sink]
// [#extension: envoy.health_check.event_sinks.file]
// Health check event file sink.
// The health check event will be converted to JSON.
message HealthCheckEventFileSink {
// Specifies the path to the health check event log.
string event_log_path = 1 [(validate.rules).string = {min_len: 1}];
}

@ -173,6 +173,7 @@ proto_library(
"//envoy/extensions/formatter/cel/v3:pkg",
"//envoy/extensions/formatter/metadata/v3:pkg",
"//envoy/extensions/formatter/req_without_query/v3:pkg",
"//envoy/extensions/health_check/event_sinks/file/v3:pkg",
"//envoy/extensions/health_checkers/redis/v3:pkg",
"//envoy/extensions/health_checkers/thrift/v3:pkg",
"//envoy/extensions/http/cache/file_system_http_cache/v3:pkg",

Loading…
Cancel
Save