stats: add histograms for request/response headers and body sizes (#11559)

Created a new struct for optional cluster stats. Moved timeout budget stats and added request response headers and body stats in the new struct.

Risk Level: Low
Testing: Added test cases
Docs Changes: added
Release Notes: added

Fixes #10308 , Fixes #3621

Signed-off-by: Ranjith Kumar <ranjith.dakshana2015@gmail.com>

Mirrored from https://github.com/envoyproxy/envoy @ a24c95e4fe035ae5d05691ee2b2bd7011093a9e9
master-ci-test
data-plane-api(CircleCI) 5 years ago
parent 0c906bbe3c
commit 8532823168
  1. 26
      envoy/config/cluster/v3/cluster.proto
  2. 33
      envoy/config/cluster/v4alpha/cluster.proto

@ -43,7 +43,7 @@ message ClusterCollection {
}
// Configuration for a single upstream cluster.
// [#next-free-field: 49]
// [#next-free-field: 50]
message Cluster {
option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.Cluster";
@ -856,7 +856,12 @@ message Cluster {
// request. These show what percentage of a request's per try and global timeout was used. A value
// of 0 would indicate that none of the timeout was used or that the timeout was infinite. A value
// of 100 would indicate that the request took the entirety of the timeout given to it.
bool track_timeout_budgets = 47;
//
// .. attention::
//
// This field has been deprecated in favor of `timeout_budgets`, part of
// :ref:`track_cluster_stats <envoy_api_field_config.cluster.v3.Cluster.track_cluster_stats>`.
bool track_timeout_budgets = 47 [deprecated = true];
// Optional customization and configuration of upstream connection pool, and upstream type.
//
@ -876,6 +881,9 @@ message Cluster {
// CONNECT only if a custom filter indicates it is appropriate, the custom factories
// can be registered and configured here.
core.v3.TypedExtensionConfig upstream_config = 48;
// Configuration to track optional cluster stats.
TrackClusterStats track_cluster_stats = 49;
}
// [#not-implemented-hide:] Extensible load balancing policy configuration.
@ -936,3 +944,17 @@ message UpstreamConnectionOptions {
// If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives.
core.v3.TcpKeepalive tcp_keepalive = 1;
}
message TrackClusterStats {
// If timeout_budgets is true, the :ref:`timeout budget histograms
// <config_cluster_manager_cluster_stats_timeout_budgets>` will be published for each
// request. These show what percentage of a request's per try and global timeout was used. A value
// of 0 would indicate that none of the timeout was used or that the timeout was infinite. A value
// of 100 would indicate that the request took the entirety of the timeout given to it.
bool timeout_budgets = 1;
// If request_response_sizes is true, then the :ref:`histograms
// <config_cluster_manager_cluster_stats_request_response_sizes>` tracking header and body sizes
// of requests and responses will be published.
bool request_response_sizes = 2;
}

@ -45,7 +45,7 @@ message ClusterCollection {
}
// Configuration for a single upstream cluster.
// [#next-free-field: 49]
// [#next-free-field: 50]
message Cluster {
option (udpa.annotations.versioning).previous_message_type = "envoy.config.cluster.v3.Cluster";
@ -545,9 +545,9 @@ message Cluster {
google.protobuf.Duration max_interval = 2 [(validate.rules).duration = {gt {nanos: 1000000}}];
}
reserved 12, 15, 7, 11, 35;
reserved 12, 15, 7, 11, 35, 47;
reserved "hosts", "tls_context", "extension_protocol_options";
reserved "hosts", "tls_context", "extension_protocol_options", "track_timeout_budgets";
// Configuration to use different transport sockets for different endpoints.
// The entry of *envoy.transport_socket_match* in the
@ -855,13 +855,6 @@ message Cluster {
// from the LRS stream here.]
core.v4alpha.ConfigSource lrs_server = 42;
// If track_timeout_budgets is true, the :ref:`timeout budget histograms
// <config_cluster_manager_cluster_stats_timeout_budgets>` will be published for each
// request. These show what percentage of a request's per try and global timeout was used. A value
// of 0 would indicate that none of the timeout was used or that the timeout was infinite. A value
// of 100 would indicate that the request took the entirety of the timeout given to it.
bool track_timeout_budgets = 47;
// Optional customization and configuration of upstream connection pool, and upstream type.
//
// Currently this field only applies for HTTP traffic but is designed for eventual use for custom
@ -880,6 +873,9 @@ message Cluster {
// CONNECT only if a custom filter indicates it is appropriate, the custom factories
// can be registered and configured here.
core.v4alpha.TypedExtensionConfig upstream_config = 48;
// Configuration to track optional cluster stats.
TrackClusterStats track_cluster_stats = 49;
}
// [#not-implemented-hide:] Extensible load balancing policy configuration.
@ -942,3 +938,20 @@ message UpstreamConnectionOptions {
// If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives.
core.v4alpha.TcpKeepalive tcp_keepalive = 1;
}
message TrackClusterStats {
option (udpa.annotations.versioning).previous_message_type =
"envoy.config.cluster.v3.TrackClusterStats";
// If timeout_budgets is true, the :ref:`timeout budget histograms
// <config_cluster_manager_cluster_stats_timeout_budgets>` will be published for each
// request. These show what percentage of a request's per try and global timeout was used. A value
// of 0 would indicate that none of the timeout was used or that the timeout was infinite. A value
// of 100 would indicate that the request took the entirety of the timeout given to it.
bool timeout_budgets = 1;
// If request_response_sizes is true, then the :ref:`histograms
// <config_cluster_manager_cluster_stats_request_response_sizes>` tracking header and body sizes
// of requests and responses will be published.
bool request_response_sizes = 2;
}

Loading…
Cancel
Save