From ce594d9b54d9916bc0a78e04a526a6d59650ddf4 Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Wed, 31 Jul 2019 14:45:26 +0000 Subject: [PATCH] api: promote tracing operation to listener level (#7723) Promote tracing operation field to listener level. This expands the scope of the field to support two use cases: Tracing TCP connections: istio can send connection events to create a service communication graph. Network filters can benefit from the common knowledge about the intent of the listener/filter chain (client-side vs server-side). Using ingress/egress designation for other telemetry. The direction of the traffic is a useful label on metrics, and it is not explicit at the moment, unless depending on tracing configuration in HTTP connection manager or naming convention. Both workarounds are not ideal. Risk Level: low Testing: all unit tests continue to pass Signed-off-by: Kuat Yessenov Mirrored from https://github.com/envoyproxy/envoy @ ca2af9723598fab4f511b59407396cc5cff9ed94 --- envoy/api/v2/core/base.proto | 12 ++++++++++++ envoy/api/v2/lds.proto | 5 ++++- .../v2/http_connection_manager.proto | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/envoy/api/v2/core/base.proto b/envoy/api/v2/core/base.proto index 6375d87e..2553fe04 100644 --- a/envoy/api/v2/core/base.proto +++ b/envoy/api/v2/core/base.proto @@ -278,3 +278,15 @@ message ControlPlane { // the Envoy is connected to. string identifier = 1; } + +// Identifies the direction of the traffic relative to the local Envoy. +enum TrafficDirection { + // Default option is unspecified. + UNSPECIFIED = 0; + + // The transport is used for incoming traffic. + INBOUND = 1; + + // The transport is used for outgoing traffic. + OUTBOUND = 2; +} diff --git a/envoy/api/v2/lds.proto b/envoy/api/v2/lds.proto index f6081fbc..dd29659c 100644 --- a/envoy/api/v2/lds.proto +++ b/envoy/api/v2/lds.proto @@ -44,7 +44,7 @@ service ListenerDiscoveryService { } } -// [#comment:next free field: 16] +// [#comment:next free field: 17] message Listener { // The unique name by which this listener is known. If no name is provided, // Envoy will allocate an internal UUID for the listener. If the listener is to be dynamically @@ -181,4 +181,7 @@ message Listener { google.protobuf.UInt32Value tcp_fast_open_queue_length = 12; reserved 14; + + // Specifies the intended direction of the traffic relative to the local Envoy. + core.TrafficDirection traffic_direction = 16; } diff --git a/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto b/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto index f579caa5..4d662fc2 100644 --- a/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto +++ b/envoy/config/filter/network/http_connection_manager/v2/http_connection_manager.proto @@ -80,6 +80,7 @@ message HttpConnectionManager { google.protobuf.BoolValue add_user_agent = 6; message Tracing { + // [#comment:TODO(kyessenov): Align this field with listener traffic direction field.] enum OperationName { option (gogoproto.goproto_enum_prefix) = false;