From 62d966781895c716c8e10230559bd8dcaaec0a78 Mon Sep 17 00:00:00 2001 From: Douglas Reid Date: Tue, 30 Jan 2018 09:48:04 -0800 Subject: [PATCH 1/3] Expose trace sampling controls Signed-off-by: Douglas Reid --- .../v2/filter/network/http_connection_manager.proto | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/envoy/api/v2/filter/network/http_connection_manager.proto b/envoy/api/v2/filter/network/http_connection_manager.proto index f7444a58d..73d1ab4f3 100644 --- a/envoy/api/v2/filter/network/http_connection_manager.proto +++ b/envoy/api/v2/filter/network/http_connection_manager.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package envoy.api.v2.filter.network; option go_package = "network"; +import "envoy/api/v2/base.proto"; import "envoy/api/v2/config_source.proto"; import "envoy/api/v2/protocol.proto"; import "envoy/api/v2/filter/accesslog/accesslog.proto"; @@ -80,6 +81,17 @@ message HttpConnectionManager { // populate the tag name, and the header value is used to populate the tag value. The tag is // created if the specified header name is present in the request's headers. repeated string request_headers_for_tags = 2; + + // Target percentage of requests managed by this HTTP connection manager that will be traced + // after all other checks have been applied (force tracing, sampling, etc.). Defaults to 100%. + // This variable is a direct analog for the variable named 'global_enabled' in the :ref:`HTTP + // Connection Manager `. + Percent sampling = 3; + + // Target percentage of requests managed by this HTTP connection manager that will be randomly + // traced. Defaults to 100%. This variable is a direct analog for the variable of the same name + // in the :ref:`HTTP Connection Manager `. + Percent random_sampling = 4; } // Presence of the object defines whether the connection manager From 39d3f427237a4e07471b740a62d609a7af8ace20 Mon Sep 17 00:00:00 2001 From: Douglas Reid Date: Tue, 30 Jan 2018 15:02:33 -0800 Subject: [PATCH 2/3] Updates to address review comments Signed-off-by: Douglas Reid --- .../network/http_connection_manager.proto | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/envoy/api/v2/filter/network/http_connection_manager.proto b/envoy/api/v2/filter/network/http_connection_manager.proto index 73d1ab4f3..aa8493afc 100644 --- a/envoy/api/v2/filter/network/http_connection_manager.proto +++ b/envoy/api/v2/filter/network/http_connection_manager.proto @@ -82,16 +82,29 @@ message HttpConnectionManager { // created if the specified header name is present in the request's headers. repeated string request_headers_for_tags = 2; - // Target percentage of requests managed by this HTTP connection manager that will be traced - // after all other checks have been applied (force tracing, sampling, etc.). Defaults to 100%. - // This variable is a direct analog for the variable named 'global_enabled' in the :ref:`HTTP - // Connection Manager `. - Percent sampling = 3; + // Target percentage of requests managed by this HTTP connection manager that will be force + // traced if the *x-client-trace-id* header is set. This field is a direct analog for the + // runtime variable 'tracing.client_sampling' in the + // :ref:`HTTP Connection Manager `. + // Default: 100% + Percent client_sampling = 3; // Target percentage of requests managed by this HTTP connection manager that will be randomly - // traced. Defaults to 100%. This variable is a direct analog for the variable of the same name - // in the :ref:`HTTP Connection Manager `. + // selected for trace generation, if not requested by the client or not forced. This field is + // a direct analog for the runtime variable 'tracing.random_sampling' in the + // :ref:`HTTP Connection Manager `. + // Default: 100% Percent random_sampling = 4; + + // Target percentage of requests managed by this HTTP connection manager that will be traced + // after all other sampling checks have been applied (client-directed, force tracing, random + // sampling). This field functions as an upper limit on the total configured sampling rate. For + // instance, setting client_sampling to 100% but overall_sampling to 1% will result in only 1% + // of client requests with the appropriate headers to be force traced. This field is a direct + // analog for the runtime variable 'tracing.global_enabled' in the + // :ref:`HTTP Connection Manager `. + // Default: 100% + Percent overall_sampling = 5; } // Presence of the object defines whether the connection manager From 9aa779951869454c0daf9a43f429bb87124a22dd Mon Sep 17 00:00:00 2001 From: Douglas Reid Date: Wed, 31 Jan 2018 10:09:31 -0800 Subject: [PATCH 3/3] Add ref for x-client-trace-id Signed-off-by: Douglas Reid --- envoy/api/v2/filter/network/http_connection_manager.proto | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/envoy/api/v2/filter/network/http_connection_manager.proto b/envoy/api/v2/filter/network/http_connection_manager.proto index aa8493afc..1e46b266a 100644 --- a/envoy/api/v2/filter/network/http_connection_manager.proto +++ b/envoy/api/v2/filter/network/http_connection_manager.proto @@ -83,9 +83,10 @@ message HttpConnectionManager { repeated string request_headers_for_tags = 2; // Target percentage of requests managed by this HTTP connection manager that will be force - // traced if the *x-client-trace-id* header is set. This field is a direct analog for the - // runtime variable 'tracing.client_sampling' in the - // :ref:`HTTP Connection Manager `. + // traced if the :ref:`x-client-trace-id ` + // header is set. This field is a direct analog for the runtime variable + // 'tracing.client_sampling' in the :ref:`HTTP Connection Manager + // `. // Default: 100% Percent client_sampling = 3;