From 1d2af7862b1f129d2fad57f1494cd280310a87ae Mon Sep 17 00:00:00 2001 From: "data-plane-api(CircleCI)" Date: Fri, 10 Apr 2020 22:32:12 +0000 Subject: [PATCH] tracing: apply tracer provider configuration defined as part of `http_connection_manager` filter (#10405) Signed-off-by: Yaroslav Skopets Mirrored from https://github.com/envoyproxy/envoy @ 449be5e74768d781b71b9375fa0ec908a3cc9b92 --- envoy/config/bootstrap/v2/bootstrap.proto | 7 +++++-- envoy/config/bootstrap/v3/bootstrap.proto | 9 ++++++--- envoy/config/bootstrap/v4alpha/BUILD | 1 - .../config/bootstrap/v4alpha/bootstrap.proto | 9 ++------- .../v2/http_connection_manager.proto | 12 ++++++++--- envoy/config/trace/v2/trace.proto | 20 ++++++++++++++----- envoy/config/trace/v3/trace.proto | 20 ++++++++++++++----- envoy/config/trace/v4alpha/trace.proto | 20 ++++++++++++++----- .../v3/http_connection_manager.proto | 12 ++++++++--- .../v4alpha/http_connection_manager.proto | 12 ++++++++--- 10 files changed, 85 insertions(+), 37 deletions(-) diff --git a/envoy/config/bootstrap/v2/bootstrap.proto b/envoy/config/bootstrap/v2/bootstrap.proto index 2aea0e37..0942c78b 100644 --- a/envoy/config/bootstrap/v2/bootstrap.proto +++ b/envoy/config/bootstrap/v2/bootstrap.proto @@ -117,8 +117,11 @@ message Bootstrap { // Optional watchdog configuration. Watchdog watchdog = 8; - // Configuration for an external tracing provider. If not specified, no - // tracing will be performed. + // Configuration for an external tracing provider. + // + // .. attention:: + // This field has been deprecated in favor of :ref:`HttpConnectionManager.Tracing.provider + // `. trace.v2.Tracing tracing = 9; // Configuration for the runtime configuration provider (deprecated). If not diff --git a/envoy/config/bootstrap/v3/bootstrap.proto b/envoy/config/bootstrap/v3/bootstrap.proto index e180fa52..9df1bbd8 100644 --- a/envoy/config/bootstrap/v3/bootstrap.proto +++ b/envoy/config/bootstrap/v3/bootstrap.proto @@ -129,9 +129,12 @@ message Bootstrap { // Optional watchdog configuration. Watchdog watchdog = 8; - // Configuration for an external tracing provider. If not specified, no - // tracing will be performed. - trace.v3.Tracing tracing = 9; + // Configuration for an external tracing provider. + // + // .. attention:: + // This field has been deprecated in favor of :ref:`HttpConnectionManager.Tracing.provider + // `. + trace.v3.Tracing tracing = 9 [deprecated = true]; // Configuration for the runtime configuration provider. If not // specified, a “null” provider will be used which will result in all defaults diff --git a/envoy/config/bootstrap/v4alpha/BUILD b/envoy/config/bootstrap/v4alpha/BUILD index 00560363..884b942b 100644 --- a/envoy/config/bootstrap/v4alpha/BUILD +++ b/envoy/config/bootstrap/v4alpha/BUILD @@ -13,7 +13,6 @@ api_proto_package( "//envoy/config/listener/v3:pkg", "//envoy/config/metrics/v3:pkg", "//envoy/config/overload/v3:pkg", - "//envoy/config/trace/v4alpha:pkg", "//envoy/extensions/transport_sockets/tls/v4alpha:pkg", "@com_github_cncf_udpa//udpa/annotations:pkg", ], diff --git a/envoy/config/bootstrap/v4alpha/bootstrap.proto b/envoy/config/bootstrap/v4alpha/bootstrap.proto index ab670faa..e76695c4 100644 --- a/envoy/config/bootstrap/v4alpha/bootstrap.proto +++ b/envoy/config/bootstrap/v4alpha/bootstrap.proto @@ -11,7 +11,6 @@ import "envoy/config/core/v4alpha/socket_option.proto"; import "envoy/config/listener/v3/listener.proto"; import "envoy/config/metrics/v3/stats.proto"; import "envoy/config/overload/v3/overload.proto"; -import "envoy/config/trace/v4alpha/trace.proto"; import "envoy/extensions/transport_sockets/tls/v4alpha/cert.proto"; import "google/protobuf/duration.proto"; @@ -85,9 +84,9 @@ message Bootstrap { core.v4alpha.ApiConfigSource ads_config = 3; } - reserved 10, 11; + reserved 10, 11, 9; - reserved "runtime"; + reserved "runtime", "tracing"; // Node identity to present to the management server and for instance // identification purposes (e.g. in generated headers). @@ -129,10 +128,6 @@ message Bootstrap { // Optional watchdog configuration. Watchdog watchdog = 8; - // Configuration for an external tracing provider. If not specified, no - // tracing will be performed. - trace.v4alpha.Tracing tracing = 9; - // Configuration for the runtime configuration provider. If not // specified, a “null” provider will be used which will result in all defaults // being used. 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 3b4c2906..f760c25d 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 @@ -161,9 +161,15 @@ message HttpConnectionManager { repeated type.tracing.v2.CustomTag custom_tags = 8; // Configuration for an external tracing provider. - // If not specified, Envoy will fall back to using tracing provider configuration - // from the bootstrap config. - // [#not-implemented-hide:] + // If not specified, no tracing will be performed. + // + // .. attention:: + // Please be aware that *envoy.tracers.opencensus* provider can only be configured once + // in Envoy lifetime. + // Any attempts to reconfigure it or to use different configurations for different HCM filters + // will be rejected. + // Such a constraint is inherent to OpenCensus itself. It cannot be overcome without changes + // on OpenCensus side. trace.v2.Tracing.Http provider = 9; } diff --git a/envoy/config/trace/v2/trace.proto b/envoy/config/trace/v2/trace.proto index 393465d2..308a97e4 100644 --- a/envoy/config/trace/v2/trace.proto +++ b/envoy/config/trace/v2/trace.proto @@ -22,12 +22,22 @@ option (udpa.annotations.file_status).package_version_status = FROZEN; // [#protodoc-title: Tracing] // Tracing :ref:`architecture overview `. -// The tracing configuration specifies global -// settings for the HTTP tracer used by Envoy. The configuration is defined by -// the :ref:`Bootstrap ` :ref:`tracing -// ` field. Envoy may support other tracers -// in the future, but right now the HTTP tracer is the only one supported. +// The tracing configuration specifies settings for an HTTP tracer provider used by Envoy. +// +// Envoy may support other tracers in the future, but right now the HTTP tracer is the only one +// supported. +// +// .. attention:: +// +// Use of this message type has been deprecated in favor of direct use of +// :ref:`Tracing.Http `. message Tracing { + // Configuration for an HTTP tracer provider used by Envoy. + // + // The configuration is defined by the + // :ref:`HttpConnectionManager.Tracing ` + // :ref:`provider ` + // field. message Http { // The name of the HTTP trace driver to instantiate. The name must match a // supported HTTP trace driver. Built-in trace drivers: diff --git a/envoy/config/trace/v3/trace.proto b/envoy/config/trace/v3/trace.proto index ec055e3c..55534a89 100644 --- a/envoy/config/trace/v3/trace.proto +++ b/envoy/config/trace/v3/trace.proto @@ -23,14 +23,24 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: Tracing] // Tracing :ref:`architecture overview `. -// The tracing configuration specifies global -// settings for the HTTP tracer used by Envoy. The configuration is defined by -// the :ref:`Bootstrap ` :ref:`tracing -// ` field. Envoy may support other tracers -// in the future, but right now the HTTP tracer is the only one supported. +// The tracing configuration specifies settings for an HTTP tracer provider used by Envoy. +// +// Envoy may support other tracers in the future, but right now the HTTP tracer is the only one +// supported. +// +// .. attention:: +// +// Use of this message type has been deprecated in favor of direct use of +// :ref:`Tracing.Http `. message Tracing { option (udpa.annotations.versioning).previous_message_type = "envoy.config.trace.v2.Tracing"; + // Configuration for an HTTP tracer provider used by Envoy. + // + // The configuration is defined by the + // :ref:`HttpConnectionManager.Tracing ` + // :ref:`provider ` + // field. message Http { option (udpa.annotations.versioning).previous_message_type = "envoy.config.trace.v2.Tracing.Http"; diff --git a/envoy/config/trace/v4alpha/trace.proto b/envoy/config/trace/v4alpha/trace.proto index c7e24549..f43c8df2 100644 --- a/envoy/config/trace/v4alpha/trace.proto +++ b/envoy/config/trace/v4alpha/trace.proto @@ -23,14 +23,24 @@ option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSIO // [#protodoc-title: Tracing] // Tracing :ref:`architecture overview `. -// The tracing configuration specifies global -// settings for the HTTP tracer used by Envoy. The configuration is defined by -// the :ref:`Bootstrap ` :ref:`tracing -// ` field. Envoy may support other tracers -// in the future, but right now the HTTP tracer is the only one supported. +// The tracing configuration specifies settings for an HTTP tracer provider used by Envoy. +// +// Envoy may support other tracers in the future, but right now the HTTP tracer is the only one +// supported. +// +// .. attention:: +// +// Use of this message type has been deprecated in favor of direct use of +// :ref:`Tracing.Http `. message Tracing { option (udpa.annotations.versioning).previous_message_type = "envoy.config.trace.v3.Tracing"; + // Configuration for an HTTP tracer provider used by Envoy. + // + // The configuration is defined by the + // :ref:`HttpConnectionManager.Tracing ` + // :ref:`provider ` + // field. message Http { option (udpa.annotations.versioning).previous_message_type = "envoy.config.trace.v3.Tracing.Http"; diff --git a/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto b/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto index 06d66055..1fd2e82e 100644 --- a/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto +++ b/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.proto @@ -148,9 +148,15 @@ message HttpConnectionManager { repeated type.tracing.v3.CustomTag custom_tags = 8; // Configuration for an external tracing provider. - // If not specified, Envoy will fall back to using tracing provider configuration - // from the bootstrap config. - // [#not-implemented-hide:] + // If not specified, no tracing will be performed. + // + // .. attention:: + // Please be aware that *envoy.tracers.opencensus* provider can only be configured once + // in Envoy lifetime. + // Any attempts to reconfigure it or to use different configurations for different HCM filters + // will be rejected. + // Such a constraint is inherent to OpenCensus itself. It cannot be overcome without changes + // on OpenCensus side. config.trace.v3.Tracing.Http provider = 9; } diff --git a/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto b/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto index 226dc272..5a05a853 100644 --- a/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto +++ b/envoy/extensions/filters/network/http_connection_manager/v4alpha/http_connection_manager.proto @@ -148,9 +148,15 @@ message HttpConnectionManager { repeated type.tracing.v3.CustomTag custom_tags = 8; // Configuration for an external tracing provider. - // If not specified, Envoy will fall back to using tracing provider configuration - // from the bootstrap config. - // [#not-implemented-hide:] + // If not specified, no tracing will be performed. + // + // .. attention:: + // Please be aware that *envoy.tracers.opencensus* provider can only be configured once + // in Envoy lifetime. + // Any attempts to reconfigure it or to use different configurations for different HCM filters + // will be rejected. + // Such a constraint is inherent to OpenCensus itself. It cannot be overcome without changes + // on OpenCensus side. config.trace.v4alpha.Tracing.Http provider = 9; }