Skip to content

xds-client: add LRS message types, LrsCodec and its prost implementation - #3012

Merged
arjan-bal merged 3 commits into
grpc:masterfrom
arjan-bal:lrs/messages
Nov 11, 2026
Merged

arjan-bal merged 3 commits into
grpc:masterfrom
arjan-bal:lrs/messages

Conversation

@arjan-bal

@arjan-bal arjan-bal commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Contributes to: #2764

This is a part of an LRS (Load Reporting Service) client for xds-client. gRPC uses LRS to report per-cluster and per-locality load (call counts, drops, backend metrics) to the control plane. The LRS client needs crate-owned message types and a codec layer, like ADS has with DiscoveryRequest / DiscoveryResponse and XdsCodec. That keeps the client logic independent of the protobuf implementation.

Follow-up PRs add the load store that records loads, and the worker that reports them over a StreamLoadStats stream.

Changes

  • A new xds_client::lrs module to keep LRS code separate from the existing ADS implementation.
  • The codec is added to the xds_client::lrs module.
  • The messages are added to xds_client::lrs::messages.
  • The existing ProstCodec also implements the LrsCodec trait. This will be used for testing the upcoming lrs worker implementation.

Adds the lrs module, with the crate-owned LoadStatsRequest and
LoadStatsResponse types, and the LrsCodec trait converting them to and
from the wire format. Locality now derives PartialEq, Eq and Hash, to be
used in the load stats, and as a map key.

@YutaoMa YutaoMa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arjan-bal arjan-bal assigned arjan-bal and unassigned YutaoMa Nov 11, 2026
@arjan-bal
arjan-bal merged commit e7a011a into grpc:master Nov 11, 2026
30 checks passed
@arjan-bal
arjan-bal deleted the lrs/messages branch November 11, 2026 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants