lrs.proto 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. syntax = "proto3";
  2. package envoy.service.load_stats.v2;
  3. import "envoy/api/v2/core/base.proto";
  4. import "envoy/api/v2/endpoint/load_report.proto";
  5. import "google/protobuf/duration.proto";
  6. import "udpa/annotations/status.proto";
  7. option java_package = "io.envoyproxy.envoy.service.load_stats.v2";
  8. option java_outer_classname = "LrsProto";
  9. option java_multiple_files = true;
  10. option go_package = "github.com/envoyproxy/go-control-plane/envoy/service/load_stats/v2;load_statsv2";
  11. option java_generic_services = true;
  12. option (udpa.annotations.file_status).package_version_status = FROZEN;
  13. // [#protodoc-title: Load reporting service]
  14. service LoadReportingService {
  15. // Advanced API to allow for multi-dimensional load balancing by remote
  16. // server. For receiving LB assignments, the steps are:
  17. // 1, The management server is configured with per cluster/zone/load metric
  18. // capacity configuration. The capacity configuration definition is
  19. // outside of the scope of this document.
  20. // 2. Envoy issues a standard {Stream,Fetch}Endpoints request for the clusters
  21. // to balance.
  22. //
  23. // Independently, Envoy will initiate a StreamLoadStats bidi stream with a
  24. // management server:
  25. // 1. Once a connection establishes, the management server publishes a
  26. // LoadStatsResponse for all clusters it is interested in learning load
  27. // stats about.
  28. // 2. For each cluster, Envoy load balances incoming traffic to upstream hosts
  29. // based on per-zone weights and/or per-instance weights (if specified)
  30. // based on intra-zone LbPolicy. This information comes from the above
  31. // {Stream,Fetch}Endpoints.
  32. // 3. When upstream hosts reply, they optionally add header <define header
  33. // name> with ASCII representation of EndpointLoadMetricStats.
  34. // 4. Envoy aggregates load reports over the period of time given to it in
  35. // LoadStatsResponse.load_reporting_interval. This includes aggregation
  36. // stats Envoy maintains by itself (total_requests, rpc_errors etc.) as
  37. // well as load metrics from upstream hosts.
  38. // 5. When the timer of load_reporting_interval expires, Envoy sends new
  39. // LoadStatsRequest filled with load reports for each cluster.
  40. // 6. The management server uses the load reports from all reported Envoys
  41. // from around the world, computes global assignment and prepares traffic
  42. // assignment destined for each zone Envoys are located in. Goto 2.
  43. rpc StreamLoadStats(stream LoadStatsRequest) returns (stream LoadStatsResponse) {
  44. }
  45. }
  46. // A load report Envoy sends to the management server.
  47. // [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
  48. message LoadStatsRequest {
  49. // Node identifier for Envoy instance.
  50. api.v2.core.Node node = 1;
  51. // A list of load stats to report.
  52. repeated api.v2.endpoint.ClusterStats cluster_stats = 2;
  53. }
  54. // The management server sends envoy a LoadStatsResponse with all clusters it
  55. // is interested in learning load stats about.
  56. // [#not-implemented-hide:] Not configuration. TBD how to doc proto APIs.
  57. message LoadStatsResponse {
  58. // Clusters to report stats for.
  59. // Not populated if *send_all_clusters* is true.
  60. repeated string clusters = 1;
  61. // If true, the client should send all clusters it knows about.
  62. // Only clients that advertise the "envoy.lrs.supports_send_all_clusters" capability in their
  63. // :ref:`client_features<envoy_api_field_core.Node.client_features>` field will honor this field.
  64. bool send_all_clusters = 4;
  65. // The minimum interval of time to collect stats over. This is only a minimum for two reasons:
  66. // 1. There may be some delay from when the timer fires until stats sampling occurs.
  67. // 2. For clusters that were already feature in the previous *LoadStatsResponse*, any traffic
  68. // that is observed in between the corresponding previous *LoadStatsRequest* and this
  69. // *LoadStatsResponse* will also be accumulated and billed to the cluster. This avoids a period
  70. // of inobservability that might otherwise exists between the messages. New clusters are not
  71. // subject to this consideration.
  72. google.protobuf.Duration load_reporting_interval = 2;
  73. // Set to *true* if the management server supports endpoint granularity
  74. // report.
  75. bool report_endpoint_granularity = 3;
  76. }