diff --git a/docs/BUILD b/docs/BUILD index 30d53452..54a7b87e 100644 --- a/docs/BUILD +++ b/docs/BUILD @@ -58,6 +58,7 @@ proto_library( "//envoy/config/trace/v2:trace", "//envoy/config/transport_socket/capture/v2alpha:capture", "//envoy/data/accesslog/v2:accesslog", + "//envoy/data/core/v2alpha:health_check_event", "//envoy/data/tap/v2alpha:capture", "//envoy/service/accesslog/v2:als", "//envoy/service/auth/v2alpha:attribute_context", diff --git a/envoy/api/v2/core/health_check.proto b/envoy/api/v2/core/health_check.proto index 6c9077bd..92c811e9 100644 --- a/envoy/api/v2/core/health_check.proto +++ b/envoy/api/v2/core/health_check.proto @@ -185,6 +185,10 @@ message HealthCheck { // // The default value for "healthy edge interval" is the same as the default interval. google.protobuf.Duration healthy_edge_interval = 16; + + // Specifies the path to the :ref:`health check event log `. + // If empty, no event log will be written. + string event_log_path = 17; } // Endpoint health status. diff --git a/envoy/data/core/v2alpha/BUILD b/envoy/data/core/v2alpha/BUILD new file mode 100644 index 00000000..740e4304 --- /dev/null +++ b/envoy/data/core/v2alpha/BUILD @@ -0,0 +1,15 @@ +load("//bazel:api_build_system.bzl", "api_proto_library") + +licenses(["notice"]) # Apache 2 + +api_proto_library( + name = "health_check_event", + srcs = ["health_check_event.proto"], + visibility = [ + "//visibility:public", + ], + deps = [ + "//envoy/api/v2/core:address", + "//envoy/api/v2/core:base", + ], +) diff --git a/envoy/data/core/v2alpha/health_check_event.proto b/envoy/data/core/v2alpha/health_check_event.proto new file mode 100644 index 00000000..5c9e28f6 --- /dev/null +++ b/envoy/data/core/v2alpha/health_check_event.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; + +package envoy.data.core.v2alpha; + +import "envoy/api/v2/core/address.proto"; +import "envoy/api/v2/core/base.proto"; + +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; + +import "validate/validate.proto"; +import "gogoproto/gogo.proto"; + +option (gogoproto.equal_all) = true; + +// [#protodoc-title: Health check logging events] +// :ref:`Health check logging `. + +message HealthCheckEvent { + HealthCheckerType health_checker_type = 1 [(validate.rules).enum.defined_only = true]; + envoy.api.v2.core.Address host = 2; + string cluster_name = 3 [(validate.rules).string.min_bytes = 1]; + + oneof event { + option (validate.required) = true; + + // Host ejection. + HealthCheckEjectUnhealthy eject_unhealthy_event = 4; + + // Host addition. + HealthCheckAddHealthy add_healthy_event = 5; + } +} + +enum HealthCheckFailureType { + ACTIVE = 0; + PASSIVE = 1; + NETWORK = 2; +} + +enum HealthCheckerType { + HTTP = 0; + TCP = 1; + GRPC = 2; + REDIS = 3; +} + +message HealthCheckEjectUnhealthy { + // The type of failure that caused this ejection. + HealthCheckFailureType failure_type = 1 [(validate.rules).enum.defined_only = true]; +} + +message HealthCheckAddHealthy { + // Whether this addition is the result of the first ever health check on a host, in which case + // the configured :ref:`healthy threshold ` + // is bypassed and the host is immediately added. + bool first_check = 1; +}