Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to receive ORCA load reports from hosts #34781

Open
efimki opened this issue Jun 17, 2024 · 1 comment
Open

Provide a way to receive ORCA load reports from hosts #34781

efimki opened this issue Jun 17, 2024 · 1 comment
Labels
area/load balancing enhancement Feature requests. Not bugs or questions.

Comments

@efimki
Copy link
Contributor

efimki commented Jun 17, 2024

Title: Provide a way to receive ORCA load reports from hosts

Description:

The ClientSideWeightedRoundRobin load balancing policy needs to receive OrcaLoadReports when they are received from the upstream host.

I propose to add an API to the HostDescription to allow LB policies and other modules to configure a callback on the Host, which will be invoked when RoutingFilter gets an ORCA report.

class HostDescription {
 …

 // Invoked each time when new custom_metrics are reported for a given host.
 using OrcaLoadReportCb = std::function<absl::Status(
     HostDescription& host, const OrcaLoadReport& orca_load_report)>;

  /*
  * Install a callback to be invoked when ORCA Load report is received for the host.
  * @param callback supplies the callback to invoke.
  * @return Common::CallbackHandlePtr a handle which can be used to unregister the callback.
  */
 Common::CallbackHandlePtr addOrcaLoadReportCb(OrcaLoadReportCb callback) const PURE;

 // Return true if Host has any CustomMetrics callbacks. Used to avoid parsing ORCA header
 // if there are no callbacks that need it.
 bool hasOrcaLoadReportCb() const PURE;

 // Invokes orca_load_report_cb attached to this host with given custom_metrics.
 void invokeOrcaLoadReportCb(const OrcaLoadReport& orca_load_report);
 …
}
@efimki efimki added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Jun 17, 2024
@tyxia tyxia added area/load balancing and removed triage Issue requires triage labels Jun 20, 2024
@tyxia
Copy link
Member

tyxia commented Jun 20, 2024

This issue seems to be somewhat related to #34777?

Added the area tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/load balancing enhancement Feature requests. Not bugs or questions.
Projects
None yet
Development

No branches or pull requests

2 participants