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