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 <iabukalbein@microsoft.com>

Mirrored from https://github.com/envoyproxy/envoy @ 1d4981bacacf33fdc5f60cfd56bede2802770a79
main
update-envoy[bot] 1 year ago
parent 8abd0cb9b3
commit 9bb8e365ab
  1. 3
      envoy/data/accesslog/v3/accesslog.proto
  2. 19
      envoy/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto

@ -44,6 +44,9 @@ enum AccessLogType {
UpstreamPeriodic = 8;
UpstreamEnd = 9;
DownstreamTunnelSuccessfullyEstablished = 10;
UdpTunnelUpstreamConnected = 11;
UdpPeriodic = 12;
UdpSessionEnd = 13;
}
message TCPAccessLogEntry {

@ -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 <https://www.rfc-editor.org/rfc/rfc9298.html>`_.
// 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;
}

Loading…
Cancel
Save