reverse_tunnel: add access logging support for initiator bootstrap extension #44326
Check was skipped
This check was not triggered in this CI run
Details
Request (pr/44326/main@b7946c8)
@roll-no-21
b7946c8 #44326
merge main@d4fd8e3
reverse_tunnel: add access logging support for initiator bootstrap extension
Commit Message: add access logging support for the reverse tunnel initiator bootstrap extension
Additional Description:
Problem:
The reverse tunnel initiator (downstream side) has no access logging support. Operators have no
structured visibility into when reverse tunnel connections are established, when handshakes fail,
or when connections are closed. The only observability available is stats counters and debug-level
ENVOY_LOG traces, which are not suitable for production monitoring or auditing.Solution:
Add a configurable
access_logfield to theDownstreamReverseConnectionSocketInterfacebootstrap
extension proto. Access loggers are instantiated from config inReverseTunnelInitiatorExtensionand
invoked at three lifecycle points inReverseConnectionIOHandle:
handshake_success— reverse tunnel handshake completed successfullyhandshake_failure— reverse tunnel handshake failed (with error details)connection_closed— an established reverse tunnel connection was torn downEach log entry carries reverse tunnel metadata as dynamic metadata under the
envoy.reverse_tunnel.initiatornamespace, accessible via standard%DYNAMIC_METADATA(...)%
format strings:
Field Description eventLifecycle event: handshake_success,handshake_failure,connection_closednode_idThe src_node_idof this initiator Envoy instancecluster_idThe src_cluster_idof this initiator Envoy instancetenant_idThe src_tenant_idof this initiator Envoy instanceupstream_clusterName of the upstream cluster this tunnel connects to host_addressResolved address of the specific upstream host connection_keyUnique identifier for this connection (correlates handshake and close events) errorFailure reason (only present on handshake_failureevents)Any access log type supported by Envoy (file, stdout, gRPC, etc.) can be used. The implementation
follows the same pattern as TCP proxy access logging — creating an ephemeralStreamInfoImplper
log entry and populating dynamic metadata before calling each configured logger.Risk Level: Low
Testing: Existing unit tests pass. Access log creation and lifecycle callsites are additive.
Docs Changes: Added access logging section todocs/root/configuration/other_features/reverse_tunnel.rst
Release Notes: N/A
Platform Specific Features: N/A
Environment
Request variables
| Key | Value |
|---|---|
| ref | 22602ff |
| sha | b7946c8 |
| pr | 44326 |
| base-sha | d4fd8e3 |
| actor | |
| message | reverse_tunnel: add access logging support for initiator bootstrap extension... |
| started | 1775753375.989046 |
| target-branch | main |
| trusted | false |
Build image
Container image/s (as used in this CI run)
| Key | Value |
|---|---|
| default | docker.io/envoyproxy/envoy-build:86873047235e9b8232df989a5999b9bebf9db69c |
| mobile | docker.io/envoyproxy/envoy-build:mobile-86873047235e9b8232df989a5999b9bebf9db69c |
Version
Envoy version (as used in this CI run)
| Key | Value |
|---|---|
| major | 1 |
| minor | 38 |
| patch | 0 |
| dev | true |