Skip to content

Commit

Permalink
UDP Proxy: Add access log options to UDP session access log (#30881)
Browse files Browse the repository at this point in the history
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 <[email protected]>

Mirrored from https://github.com/envoyproxy/envoy @ 1d4981bacacf33fdc5f60cfd56bede2802770a79
  • Loading branch information
update-envoy[bot] committed Nov 30, 2023
1 parent 8abd0cb commit 9bb8e36
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions envoy/data/accesslog/v3/accesslog.proto
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ enum AccessLogType {
UpstreamPeriodic = 8;
UpstreamEnd = 9;
DownstreamTunnelSuccessfullyEstablished = 10;
UdpTunnelUpstreamConnected = 11;
UdpPeriodic = 12;
UdpSessionEnd = 13;
}

message TCPAccessLogEntry {
Expand Down
19 changes: 18 additions & 1 deletion envoy/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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}];

Expand Down Expand Up @@ -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;
}

0 comments on commit 9bb8e36

Please sign in to comment.