• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2020 The gRPC Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Local copy of Envoy xDS proto file, used for testing only.
16
17syntax = "proto3";
18
19package envoy.config.endpoint.v3;
20
21import "src/proto/grpc/testing/xds/v3/address.proto";
22import "src/proto/grpc/testing/xds/v3/base.proto";
23
24import "google/protobuf/duration.proto";
25import "google/protobuf/struct.proto";
26
27// These are stats Envoy reports to GLB every so often. Report frequency is
28// defined by
29// :ref:`LoadStatsResponse.load_reporting_interval<envoy_api_field_service.load_stats.v3.LoadStatsResponse.load_reporting_interval>`.
30// Stats per upstream region/zone and optionally per subzone.
31// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
32// [#next-free-field: 9]
33message UpstreamLocalityStats {
34  // Name of zone, region and optionally endpoint group these metrics were
35  // collected from. Zone and region names could be empty if unknown.
36  core.v3.Locality locality = 1;
37
38  // The total number of requests successfully completed by the endpoints in the
39  // locality.
40  uint64 total_successful_requests = 2;
41
42  // The total number of unfinished requests
43  uint64 total_requests_in_progress = 3;
44
45  // The total number of requests that failed due to errors at the endpoint,
46  // aggregated over all endpoints in the locality.
47  uint64 total_error_requests = 4;
48
49  // The total number of requests that were issued by this Envoy since
50  // the last report. This information is aggregated over all the
51  // upstream endpoints in the locality.
52  uint64 total_issued_requests = 8;
53
54  // Stats for multi-dimensional load balancing.
55  repeated EndpointLoadMetricStats load_metric_stats = 5;
56
57  // Endpoint granularity stats information for this locality. This information
58  // is populated if the Server requests it by setting
59  // :ref:`LoadStatsResponse.report_endpoint_granularity<envoy_api_field_service.load_stats.v3.LoadStatsResponse.report_endpoint_granularity>`.
60  repeated UpstreamEndpointStats upstream_endpoint_stats = 7;
61
62  // [#not-implemented-hide:] The priority of the endpoint group these metrics
63  // were collected from.
64  uint32 priority = 6;
65}
66
67// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
68// [#next-free-field: 8]
69message UpstreamEndpointStats {
70  // Upstream host address.
71  core.v3.Address address = 1;
72
73  // Opaque and implementation dependent metadata of the
74  // endpoint. Envoy will pass this directly to the management server.
75  google.protobuf.Struct metadata = 6;
76
77  // The total number of requests successfully completed by the endpoints in the
78  // locality. These include non-5xx responses for HTTP, where errors
79  // originate at the client and the endpoint responded successfully. For gRPC,
80  // the grpc-status values are those not covered by total_error_requests below.
81  uint64 total_successful_requests = 2;
82
83  // The total number of unfinished requests for this endpoint.
84  uint64 total_requests_in_progress = 3;
85
86  // The total number of requests that failed due to errors at the endpoint.
87  // For HTTP these are responses with 5xx status codes and for gRPC the
88  // grpc-status values:
89  //
90  //   - DeadlineExceeded
91  //   - Unimplemented
92  //   - Internal
93  //   - Unavailable
94  //   - Unknown
95  //   - DataLoss
96  uint64 total_error_requests = 4;
97
98  // The total number of requests that were issued to this endpoint
99  // since the last report. A single TCP connection, HTTP or gRPC
100  // request or stream is counted as one request.
101  uint64 total_issued_requests = 7;
102
103  // Stats for multi-dimensional load balancing.
104  repeated EndpointLoadMetricStats load_metric_stats = 5;
105}
106
107// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
108message EndpointLoadMetricStats {
109  // Name of the metric; may be empty.
110  string metric_name = 1;
111
112  // Number of calls that finished and included this metric.
113  uint64 num_requests_finished_with_metric = 2;
114
115  // Sum of metric values across all calls that finished with this metric for
116  // load_reporting_interval.
117  double total_metric_value = 3;
118}
119
120// Per cluster load stats. Envoy reports these stats a management server in a
121// :ref:`LoadStatsRequest<envoy_api_msg_service.load_stats.v3.LoadStatsRequest>`
122// [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
123// Next ID: 7
124// [#next-free-field: 7]
125message ClusterStats {
126  message DroppedRequests {
127    // Identifier for the policy specifying the drop.
128    string category = 1;
129
130    // Total number of deliberately dropped requests for the category.
131    uint64 dropped_count = 2;
132  }
133
134  // The name of the cluster.
135  string cluster_name = 1;
136
137  // The eds_cluster_config service_name of the cluster.
138  // It's possible that two clusters send the same service_name to EDS,
139  // in that case, the management server is supposed to do aggregation on the load reports.
140  string cluster_service_name = 6;
141
142  // Need at least one.
143  repeated UpstreamLocalityStats upstream_locality_stats = 2;
144
145  // Cluster-level stats such as total_successful_requests may be computed by
146  // summing upstream_locality_stats. In addition, below there are additional
147  // cluster-wide stats.
148  //
149  // The total number of dropped requests. This covers requests
150  // deliberately dropped by the drop_overload policy and circuit breaking.
151  uint64 total_dropped_requests = 3;
152
153  // Information about deliberately dropped requests for each category specified
154  // in the DropOverload policy.
155  repeated DroppedRequests dropped_requests = 5;
156
157  // Period over which the actual load report occurred. This will be guaranteed to include every
158  // request reported. Due to system load and delays between the *LoadStatsRequest* sent from Envoy
159  // and the *LoadStatsResponse* message sent from the management server, this may be longer than
160  // the requested load reporting interval in the *LoadStatsResponse*.
161  google.protobuf.Duration load_report_interval = 4;
162}
163