interceptors c#

18 views
Skip to first unread message

Krzysiek

unread,
Jun 4, 2019, 3:20:06 AM6/4/19
to grpc.io

hi, 

Is it possible to log all traffic incoming to the server via interceptor ?

I run Grpc server, but my client sometimes change "proto" contracts (because he's cooperating with other companies and usually "forget" to inform us).
I have implemented interceptor (using C# Grpc.Core.Interceptors UnaryServerHandler) to log requests, but it won't work for those endpoints that are not in my version of contract.

thanks,
Krzysiek 

Jan Tattermusch

unread,
Jun 4, 2019, 12:36:29 PM6/4/19
to Krzysiek, grpc.io
Currently interceptors in c# are invoked after deserializing the request and before serializing the response, so if you can't really deserialize the response, interceptors won't work for you.

One option would be to setup a "generic" handler that accepts the raw payload instead of protobuf messages, but then you would be responsible for (de)serializing the protobufs yourself (which seems clumsy).
You could perhaps also use some kind of proxy (Envoy?) that could log the requests for you.

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/d817f4de-7c5b-411e-8f29-761af336351c%40googlegroups.com.


--

Jan

Reply all
Reply to author
Forward
0 new messages