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

Support binary logging of wire protocol data #2118

Open
tweidema opened this issue Nov 15, 2024 · 1 comment
Open

Support binary logging of wire protocol data #2118

tweidema opened this issue Nov 15, 2024 · 1 comment
Labels
kind/enhancement Improvements to existing feature.

Comments

@tweidema
Copy link

Describe the solution you'd like

In Release 2.x I would like to see support for binary logging, maybe based on https://github.com/grpc/grpc/blob/master/doc/binary-logging.md . Should include both message- and meta-data.
My use-case is a low-overhead, but complete log of traffic server-side, to/from clients, primarily for use in supportcases. Logging the binary protocol data should be low-overhead in the call-path and take up less storage (as opposed to logging deserialized/parsed messages), and it doesn't matter (to me) if it then takes time to search/parse the data when there is a need for it.
Another usecase would be documenting/replaying integration testruns.
I've looked in the source-code, and Sources/GRPCCore/Call/Server/Internal/ServerRPCExecutor.swift seems to be the place for it, at least for incoming traffic.

Describe alternatives you've considered

Logging deserialized/parsed data from single methods or from a serverInterceptor if possible.

@tweidema tweidema added the kind/enhancement Improvements to existing feature. label Nov 15, 2024
@glbrntt
Copy link
Collaborator

glbrntt commented Dec 18, 2024

This would certainly be nice to have. I'm not sure how we should add this at the moment though. For one, we don't have (and don't want) a protobuf dependency in this package; we also don't have complete information (peer information and some metadata is provided at the transport layer, for example). One approach might be to define a binary logger API which different transport implementations emit appropriate events into and have a decoupled backend which you can consume the events from (i.e. turn the binary log events into protobuf messages).

Logging deserialized/parsed data from single methods or from a serverInterceptor if possible.

You should be able to get most of the info with this approach but you'd need to reserialize the messages which isn't something we'd like to do in a general purpose solution as it can be pretty costly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements to existing feature.
Projects
None yet
Development

No branches or pull requests

2 participants