From 9bb8e365ab65cfcd5307f011b0fb6d622b8ae113 Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 17:48:28 +0000 Subject: [PATCH] UDP Proxy: Add access log options to UDP session access log (#30881) Add access log options for UDP session access log to support flushing session access log periodically, and support flushing session access log on upstream tunnel connected when using UDP tunneling. Additional Description: Risk Level: low Testing: unit tests, integration tests Docs Changes: Release Notes: Platform Specific Features: None Signed-off-by: Issa Abu Kalbein Mirrored from https://github.com/envoyproxy/envoy @ 1d4981bacacf33fdc5f60cfd56bede2802770a79 --- envoy/data/accesslog/v3/accesslog.proto | 3 +++ .../filters/udp/udp_proxy/v3/udp_proxy.proto | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/envoy/data/accesslog/v3/accesslog.proto b/envoy/data/accesslog/v3/accesslog.proto index 56d9e7b8c..25e7a80bb 100644 --- a/envoy/data/accesslog/v3/accesslog.proto +++ b/envoy/data/accesslog/v3/accesslog.proto @@ -44,6 +44,9 @@ enum AccessLogType { UpstreamPeriodic = 8; UpstreamEnd = 9; DownstreamTunnelSuccessfullyEstablished = 10; + UdpTunnelUpstreamConnected = 11; + UdpPeriodic = 12; + UdpSessionEnd = 13; } message TCPAccessLogEntry { diff --git a/envoy/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto b/envoy/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto index 391c266f1..1d07668ac 100644 --- a/envoy/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto +++ b/envoy/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto @@ -29,7 +29,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#extension: envoy.filters.udp_listener.udp_proxy] // Configuration for the UDP proxy filter. -// [#next-free-field: 13] +// [#next-free-field: 14] message UdpProxyConfig { option (udpa.annotations.versioning).previous_message_type = "envoy.config.filter.udp.udp_proxy.v2alpha.UdpProxyConfig"; @@ -170,6 +170,20 @@ message UdpProxyConfig { bool propagate_response_trailers = 11; } + message UdpAccessLogOptions { + // The interval to flush access log. The UDP proxy will flush only one access log when the session + // is ended by default. If this field is set, the UDP proxy will flush access log periodically with + // the specified interval. + // This field does not require on-tunnel-connected access logging enabled, and the other way around. + // The interval must be at least 1ms. + google.protobuf.Duration access_log_flush_interval = 1 + [(validate.rules).duration = {gte {nanos: 1000000}}]; + + // If set to true and UDP tunneling is configured, access log will be flushed when the UDP proxy has successfully + // established a connection tunnel with the upstream. If the connection failed, the access log will not be flushed. + bool flush_access_log_on_tunnel_connected = 2; + } + // The stat prefix used when emitting UDP proxy filter stats. string stat_prefix = 1 [(validate.rules).string = {min_len: 1}]; @@ -241,4 +255,7 @@ message UdpProxyConfig { // If set, this configures UDP tunneling. See `Proxying UDP in HTTP `_. // More information can be found in the UDP Proxy and HTTP upgrade documentation. UdpTunnelingConfig tunneling_config = 12; + + // Additional access log options for UDP Proxy. + UdpAccessLogOptions access_log_options = 13; }