Skip to content

Move RPC byte-counting logic to separate gRPC stream wrappers #9057

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iain-macdonald
Copy link
Contributor

No description provided.

Copy link
Member

@bduffany bduffany left a comment

Choose a reason for hiding this comment

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

what was wrong with bytesRead += proto.Size(rsp)? the stream wrapper seems comparatively more complicated 🤔

@iain-macdonald
Copy link
Contributor Author

what was wrong with bytesRead += proto.Size(rsp)? the stream wrapper seems comparatively more complicated 🤔

My thinking here is that it would be nice to have gRPC-level logging for bytes sent over the wire, like the request and latency metrics available from go-grpc-middleware and adding these stream-wrappers is a step towards doing that. Not super tied to the idea at the moment though if you feel it's not worth the extra complexity in that grpc_stream package.

@tylerwilliams
Copy link
Member

Does prometheus grpc middleware not provide this?

@iain-macdonald
Copy link
Contributor Author

Does prometheus grpc middleware not provide this?

It does not.

@bduffany
Copy link
Member

bduffany commented Apr 24, 2025

@iain-macdonald got it - would it make sense to do this using custom gRPC middleware? (in interceptors.go)

(we do some server stream wrapping there already)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants